Forums » Suggestions

Internal and external scripting, virtual networks in VO

«12
Sep 06, 2005 terjekv link
some advice:

1) what "top" is saying is irrelevant, you're provoking some I/O and burst CPU, this is can be noticable ingame if you're unlucky, and Murphy would suggest you get unlucky at the wrong time. I'm speaking from experience here. :-p

2) reparsing a log, fine. hit verbose for a while and reparse a 10M logfile, not so fine. the proper thing to do is to implement tail and cache any stateful data you need. what? you'll never use verbose? I think you will.

3) sector and system data is highly useful for *many* things. you will want to cache this. first, you'll need to do this to report storms. secondly, you'll need your current position to produce navroutes. third, you'll want the current position to do lookups to find ores, bots, trade widgets, weapons, ships and guildmates. and of course, you'll use the position again to create the navroute to go to the stuff you've found.

4) one thread does reads and dispatches events, another thread populates the loaded file every second. this ensures that you with as much accuracy as possible populate the file every second, and that *whatever* events are dispatched through the handler doesn't interfer with the timing of the writes.

5) all events processed just share an API to enqueue data that is going to be written to the file, and this buffer is locked, written and emptied by the populate function called by the thread that writes to the loaded file.

6) you might want to have other functions that are timing dependant. maybe you wish to check the top racetrack times every fifteen minutes and report changes? well, here you go, another thread that enqueues data every so often.

thing is, the threaded approch removes a lot of complexities with regards to timing issues.

and, uhm, hi, I'm Alamar. and, uhm, I'd like to point you to point 14 in the current Rules of Conduct:

# 14. You will not create, use or provide any server emulator or
# other site where Vendetta Online may be played, and you will
# not post or distribute any utilities, emulators or other
# software tools related to Vendetta Online without the express
# written permission of Guild Software Inc.

I'm still waiting for a reply with reagards to the software and utilites I have written. if I get written consent from Guild, I can show some of this stuff and make it publically available as has been the plan for a while. :-)

I'm more than happy to provide conceptual ideas and give some advice, but I won't be showing much code for now.
Sep 06, 2005 roguelazer link
1) known

2) Both his code and (now) mine implement a stateful tail. I think mine works better than his, though. :P

4) \
5) - Done
6) /
Sep 06, 2005 a1k0n link
This is all such a terrible hack that I'll be happy to allow you to execute Lua scripts from within the game.

BTW, we use Bresenham's line drawing algorithm to determine which sectors you hit when sector jumping.
Sep 06, 2005 Celkan link
a1k0n: Let me guess... draw a pixellated line (1:1 pixel scale) equivalent to the line from (X1,Y1) to (X2,Y2) substituting (X1,Y1) with your start location and (X2,Y2) with you end location. Any pixels that show up on that line have their coordinates taken and those are translated back into the navroute--those are the sectors you go through.

*checks wikipedia*

Yeah, from what I understand of the math there that is how it works.
Sep 06, 2005 Klepto link
a1k0n: You mean we can use Lua scripts on the other end of the Ugly Hack but not ruby or perl? Or the game has Lua scripting and I just don't know it? If the Ugly Hack is sanctioned then what are the chances of at least a /log command? Tnx for info on the algorithm, would have been my 1st guess ;)

Alamar, greets :D

1. True, but I did have it using 99.8% CPU in once when I missed out the sleep :)

2&3. I agree, that's the way it works

4. rougelazer says the same thing and you may well be right. It seems to me that using threads causes more synchronization problems than it solves, my approach seems to work fine in testing (so far). Threads on the other hand are more elegant and efficient. I may well be wrong and change it at some point but not quite yet :)

5. Yes, buffered writes are fairly high on my to do list.

6. There are other ways to do that, but it does lend more weight to using threads.

14. Oops, sorry. I assumed since it all went through VO script and it was all an Ugly Hack it would be OK. I don't see much scope for cheating. If I am wrong then say the word and I'll remove the download and go and cook some rocks instead :)

Edit: I am currently re-writing using threads. How about the best of both worlds? I avoided the problem by syncing with VO every time I write the script file. This slows things up and causes a huge amount of superflous messages. A thread has the problem of getting out of sync. Why not send one superflous message every so many times the script file is written to resync the thread?
Sep 06, 2005 a1k0n link
I mean that an undisclosed future version of the game will have Lua scripting built in, so you can avoid the Ugly Hack entirely and use any language on the other end.

The only 'scope for cheating' with that is the ability to make a "trade bot" or "mining bot" or "botting bot" or whatever... I'm of the opinion that we can cope with this by simply allowing everybody (to a certain extent) to script their characters actions while they are offline so the advantage of using an online script isn't as great, but I'm not certain that this is a good idea.
Sep 06, 2005 roguelazer link
Neat.
Sep 06, 2005 Klepto link
Wow, looks like you guys are way ahead of me :)

I'll abandon Ugly Hack then, and wait for the real thing. Thanks everyone for your help and advice, I've had great fun playing with this for a couple of days. Looks like I'll have to go and learn lua now.
Sep 06, 2005 Celkan link
anyway, as far as I can tell, both UID and PFS have been given the OK by Incarnate (though an offical COOL! AWESOME! GO FOR IT! in the thread by him would certainly be nice)... UID was Incarnate's idea in the first place-- a few players just took the framework he had mentioned in a post and created something in the interim of it being made on Guild's end-- and I remember being told to go ahead.
Sep 07, 2005 terjekv link
a1k0n, I do the same for navroutes, using that to map your paths to see if you're passing through a storm sector. that's a fairly easy part. the hard part is what you do if you hit a storm and want to plot around it. since A1 is just as close a node as I16 (for now?) both of those have equal weight, meaning they both have to be tested to see if they produce the best possible route.

one hackish way around this is to accept the first route that only has one stop between you and your target, but, well, it would have been nice to plot through as few roid sectors as possible and so on. I have an algorithm that does pretty much this, but if you're plotting from Deneb to Odia, it does require quite a bit of checking.

anyway, the reason I'm waiting for explicit written consent has nothing to do with the concept of cheating, but with the wording of the ROC:

# and you will not post or distribute any utilities, emulators or
# other software tools related to Vendetta Online without the
# express written permission of Guild Software Inc.

even if it's not cheating, it's a software tool or a utility related to Vendetta Online. so, uhm, a reply to my mails would be appreciated. :-)