View Single Post
  #1  
Old February 26th, 2004, 05:10 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default RanGame (random game generator project)

The DomMap project is going along well and able to create decent playable maps for Dom2. This thread is to discuss side programs such as I run which add randoms to the .map text file controlling the game which is played on a map. Examples of a randomized game can be found at my site such as the "Poke in the Eye"...
http://www.techno-mage.com/~dominion...2/Poke_Eye.map
which uses the eye.tga everyone gets with both the demo and the full game. It is re-randomized daily at my site scattering completely new surprises.


Psuedo-Code
-----------

copy the old .map to new keeping all of the #terrain and #neighbor
open new .map for append
add a line of "------------------" just for clarity between old and new

if the person adds AIs this randomly allies some
loop 13 times
Ally1 = random(0-17)
Ally2 = random(0-17)
if Ally1=Ally2 then redo
print "#allies " Ally1 Ally2
next loop

loop 1 to MaxProvinces how many provinces on the image
print "#setland " loop
X=random(0-50)
if X 0 then
print "#lab"
print "#temple"
print "# fort " random(0-24)
if X = 1 then fort and lab
if X = 2 then fort and temple
if X = 3 then lab and temple
if X = 4 then fort
if X = 5 then lab
if X = 6 then temple
if X = 7 then fort
if X = 8 then temple
if X greater than 8 then nothing
done with X now

Comndr = random(0 to MaxUnits) I think thats 1064 now?
BodyGrd = Comndr +or- random(1 to 5)
UnitType = Comndr +or- random (1 to 10)
print "#commander " Comndr
print "#randomequip 4"
print "#bodyguards " BodyGrd random(1 to 5)
print "#units " UnitType random(1 to 15)
next loop do the next province

[ February 26, 2004, 15:12: Message edited by: Gandalf Parker ]
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote