AI in Roller-coaster Tycoon
I''m interested in finding out how Chris Sawyer did the AI in RCT. Did he realy use a struct for EACH PERSON? Wouldn''t this take HEAPS of memory??
XEOS Digital Development - Supporting the independant and OpenSource game developers!
I dont know how he did it, but i have coded a similar game. If there are say, 600 people, and you are tracking a total of say 20 variables for them, each of 4 bytes then thats 80*600 = 48k of RAM.
Lets say he was needing 100 variables, and had room for 1000 people, thats still only 400k. minimal compared with the bitmaps required. The real challenge with games like that appears to be balancing all the thresholds so that the AI model works in a cohesive and logical way, the RAM requirements arent the problem.
http://www.positech.co.uk
Edited by - cliffski on 1/28/00 2:56:34 AM
Lets say he was needing 100 variables, and had room for 1000 people, thats still only 400k. minimal compared with the bitmaps required. The real challenge with games like that appears to be balancing all the thresholds so that the AI model works in a cohesive and logical way, the RAM requirements arent the problem.
http://www.positech.co.uk
Edited by - cliffski on 1/28/00 2:56:34 AM
January 28, 2000 02:32 PM
Does that mean I create X number of People, where each People is a struct / class?
That''s right, or you create an array of maximum size, or a class that dynamically allocates more room as people are added. He might have done some stuff with data packing (i.e. using every bit of information in the People struct). But to answer the first question: since each object has individual characterstics (which it already does, specifically position in the park), it has to be tracked somehow. It''s really not that much memory, in this age of virtual memory at least.
Hi
I do strongly believe he would want to use classes
and... well if he has a vector for position, and some var to control, hungry, thrist, happiness, what ever, and all took 10 bytes, i can say 1 mg for 100 persons is not much
in my curent game i need about 30 mgs just for the map (dont critikise i need them and thats final
even if it expands to 10 mgs, thats no real problem cause minimum to any computer now should be 32 and if possible more
bye
I do strongly believe he would want to use classes
and... well if he has a vector for position, and some var to control, hungry, thrist, happiness, what ever, and all took 10 bytes, i can say 1 mg for 100 persons is not much
in my curent game i need about 30 mgs just for the map (dont critikise i need them and thats final
even if it expands to 10 mgs, thats no real problem cause minimum to any computer now should be 32 and if possible more
bye
It's good to be an outcast, you don't need to explain what you do, you just do it and say you don't belong there.
January 29, 2000 06:17 AM
RCT uses an array of 5,000 structures at 256 bytes each (total 1,280,000 bytes) for the people in the game. The number of people you can get is less than that because the same structure array is also used for the ride position info. If it can move around or come and go in the game it uses one of those structs. The graphics are elsewhere. Not sure about the AI - they''re pretty stupid guests.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement