Hi, i've been making some tweaks to the AI's and everything is going well but I have an issue trying to get x y xdir ydir info from the cycles
I added this code into gAIPlayer::Timestep in src/tron/gAIBase.cpp
currently it doesnt do anything except read x y xdir and ydir but it just seems to lockup the server.
does anyone know what im doing wrong ?. thanks
You're looping through all game objects, not all of them are actually cycles. You want to check to see the return from dynamic_cast is not null...
Also, I didn't see where "lbm" was defined, so I made that a tString:
that if(target) fixed the crashing issue but I now I realise im also getting target coordinates from the ai cycle too so any test I was going to do will fail as it'll be tested against itself
-------------- edit -------------
actually it might work as the difference between the ai and itself will be 0 hmmmm
randomly changing stuff in your code until it works is "hacky" and "bad coding practice"
do it fast enough and its "machine learning"
if I used this line but with a string variable containing a filename do you think the game accept the new settings ?
I know how to add commands to armagetron to set variables but I have no idea how to make a command that will trigger a call to my function to load the file
randomly changing stuff in your code until it works is "hacky" and "bad coding practice"
do it fast enough and its "machine learning"
No reason why it wouldn't, afaik. You might need to edit the contents of aiplayers.cfg instead, though - perhaps cycling through iterations of the file. I don't have the source in front of me at the moment, though, so I can't be certain that this file isn't loaded on server startup rather than on round cycling.
A concern I can think of, if its anything like the language file situation: it will load the new stuff into RAM but also keep holding the old stuff in RAM. Therefore, you might have to clear the old contents somehow before loading the new.