🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

My SC system!!!

Started by
-1 comments, last by TheQ 20 years ago
Someone suggested a thread about our (fellow GameDev.net) scripting experiences/sytems... Ok, so I will share! Here is the basis of my SC system. I had the idea for this back in my VBDOS day, but I was using VBDOS so concepts like "wouldn't it be nice if I had some sotr of pointer to a memory address, and I could increment down a list of items in an array? Wow! Too bad I can't..." weren't gonna happen. My SC - Server/Client system. It's a very thought out method of sharing data between modules, from the server (my gamming engine) to the clients (scripter, console, 3d scene manager, sound system). The server is the engine, it's always there, I can then create an extrenal system like a sciprter or console, or recently a sound manager and internet interface. Than I cna share data between the two - for instance, I can create lines of script (note: hence forth scripting in my engine can eitehr be through a file at run time, or even through hte console) to create a internet interface at the same time send a message to the sound manager to create a sound for the event. To simplify the SC to it's nuts and bolts: I have a link list on the server, a function simply waits to have a message put into it (all classes inherit a function called "sendcommand" and "takecommand", send command sends the command to this function). Once the functions gets a hold of a command it firstly parses it (to optimize for speed), all this means is it chops up the command into a class which can determine key wording ("play "dogbark1"" would produce function"play", with arguements(1){"dogbark1"}). So then the server first would check if it wants the command "play", through takecommand, takecommand either returns that it took the command, didn't want it, hated it (error), or took it but also wants to leave it alive (as with commands that affect all clients). server passes the command through the link list of clients calling they're takecommand. For me tt's much mroe complex and powerfull now - took alot of planning and many core rewrites. I now of a matrix of databases linked together from each client and the server allowing me to create varaibles, arrays and structures from the command line (that is the console or a script), I can run scripts from within a script, include a script as a sort of a header. But with all that said, the biggest trick to any coding project is keep it simple! You can adjust things the way you want it in the end, and I donm't really see "tic tac toe" benefiting from a scripter or from my SC System. Some may think of the speed issues with all of this, especialy NOT compiling the script - firstly, I could easily add special code handling that routes compiled code just as easy, thouh it would currently defy the point! I use the scripter and console for debuging mainly. And speed isn't an issue anyways! I use to worry about speed but then I realzied one simple thing: commands are sent maybe in a group of 1 to 10 every few minutes! They are mainly used for key events, and if I took 1 command every second you would notice NO slow down at all - so even optimizing this code would be redundant. No need to optimize scripters. Need any advice? Give any advice? I'm always here :) -Q

This topic is closed to new replies.

Advertisement