Mine GO BOOM - Sat Jun 28, 2003 1:35 pm
Post subject:
Thats something that bothers me still. Why didn't Jeff just make the spec ship always be 0, instead of keeping it the highest number?
When i made my own bot core (which did fail, too unstable at times, didn't have time to re-write it), i liked the idea of specs being 0, ships being numbers. But when your working with the server, which keeps everything like the packets, i'm unsure if you should switch it around. Most of the sysops of zones will think like the client (1-8 = ships), but the programmers will think like the server (0-7 = ships).
By the way, you going to try to make this as advanced as like it is with Starcraft/Warcraft? To include other triggers, such as deaths, flags, etc?
Could i recommend you using a linked list, so you can have unlimited triggers? Plus, it keeps memory sizes smaller when you only use like 2 triggers.
Smong - Sun Jun 29, 2003 12:44 pm
Post subject:
Unlimited triggers is possible (100 per arena ATM), but it checks every 80ms for player positions so I don't think you would get away with no lag (unless you have a really fast computer, but that's cheating).
I've never played Starcraft/Warcraft so I wouldn't know about their triggers. I think triggers on flags really deserves its own flag gametype. Triggers on deaths would require extra code so they only occur after the respawn delay. What I would really like is a non-repeating trigger that doesn't require a warp.
I would imagine less than half the allocated space for each trigger is being used. I thought using a struct with all the trigger's data would make it easy to add new actions and to cleanup afterwards.
If you can explain your linked list method a bit more I will probably add it in at some point. Maybe a callback would be better so that people can easily add their own actions?
typedef void (*TriggerFunc)(Player *p, int trigger);
Mine GO BOOM - Sun Jun 29, 2003 5:56 pm
Post subject:
Correct me if i'm wrong, but i believe most collision detection systems in games work by splitting walls into groups, so it would be like a sparse array. So instead of checking every trigger for every position, you would do a bit of work before hand. Say you divide the map into a 10x10 block, and when loading arrays, you load them into linked lists inside each block. So that way, whenever you need to check a person's triggers, you can first do a simple check to see if that one block out of the 100 has any data in it. If so, can check those (or make another sparse array under that to check) to see if any of them match. Better than having 100 triggers all over the map, and check them vs every player every 80 ms. I believe the current method for storing map tiles is setup like this, can take a look at that.
As for linked lists, its pretty simple, since Grelminar set it up already inside the util.c for anyone to use. Most of the modules use them heavily to store data, take a look around it for some good examples.
Smong - Tue Oct 14, 2003 1:18 pm
Post subject:
I've been working on a better version of my trigger module, but it's not doing what it should do. My test code is supposed to say in the chat the name of the sector you are in (assigned from .conf).
I can enter the arena with the module attached, then when I type stuff or try to change ship it appears in the server console, but nothing happens in game. After a little while ctm says disconnected (no data). Can someone please look at the code and try to figure it out?
I would consider using the already existing region code in ASSS, but I am unsure of it's real purpose (soccer goals?) and of the file format.