|
|
|
|
February 26th, 2004, 05:10 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
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!)
|
February 26th, 2004, 11:07 PM
|
Sergeant
|
|
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: RanGame (random game generator project)
I've implemented your algorithm in a perl module, and also added support for it in the run_dom_map.pl script (by using the option "-Rm")
You can find all the scripts I've worked on as a zip-file at http://home.Online.no/~rmoldskr/Dominions/DomUtils.zip
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
|
February 27th, 2004, 03:45 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: RanGame (random game generator project)
Hmmm merged with the random generator would knock one one problem I thought of. If anyone does a standalone it would probably be a good "user friendly" thing to make it do a renaming of a map file. That way if the person runs it on eye.map the will still have eye.map and also eyex.map which will let them play in MP games later without messing things up.
Should probably also modify the #dom2title in the file accordingly. The targa doesnt need renamed by this program.
__________________
-- 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!)
|
February 27th, 2004, 04:31 PM
|
Sergeant
|
|
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: RanGame (random game generator project)
Quote:
Originally posted by Gandalf Parker:
Hmmm merged with the random generator would knock one one problem I thought of. If anyone does a standalone it would probably be a good "user friendly" thing to make it do a renaming of a map file. That way if the person runs it on eye.map the will still have eye.map and also eyex.map which will let them play in MP games later without messing things up.
Should probably also modify the #dom2title in the file accordingly. The targa doesnt need renamed by this program.
|
I didn't think about that. Right now the generator just removes the old .map file and replaces it with a new. I'll change it so it creates two .map files when I get home from work.
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
|
February 27th, 2004, 05:48 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: RanGame (random game generator project)
OK a stepup that I added to mine. Sometimes I wanted to play a particular nation as being majorly boosted so I added a random to decide whether or not one of the special locations should cause a #own command to print. Such as selecting Ulm and having each fort/lab/temple site randomly decide whether to also make it an Ulm owned site.
Should I do the step-ups one at a time? they are easier to follow and we can discuss them that way. Or should I just to the "totally insane no one would possibly want to play this" list of all the step-ups including the ones I havent gotten to work right yet?
Is anyone lurking this thread who has a request?
[ February 27, 2004, 15:49: 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!)
|
February 27th, 2004, 05:50 PM
|
Sergeant
|
|
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: RanGame (random game generator project)
Quote:
Originally posted by Gandalf Parker:
OK a stepup that I added to mine. Sometimes I wanted to play a particular nation as being majorly boosted so I added a random to decide whether or not one of the special locations should cause a #own command to print. Such as selecting Ulm and having each fort/lab/temple site randomly decide whether to also make it an Ulm owned site.
Should I do the step-ups one at a time? they are easier to follow and we can discuss them that way. Or should I just to the "totally insane no one would possibly want to play this" list of all the step-ups including the ones I havent gotten to work right yet?
Is anyone lurking this thread who has a request?
|
Just do the full list - that way I can choose the ones I think are easiest to implement first.
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
|
February 27th, 2004, 07:06 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: RanGame (random game generator project)
Hmmm where to begin. Lets see.....
the commanders coming from the full list gets alittle crazy. The easiest next step was to create a second routine for assiging a random commander. So I created a logical one which which selects only from 0-293 and ignores these
data 109,156,157,158,159,215,216,91,120,138
(god forms)
I thought about ignoring the large section of mages there also but left that in. I also lowered how many of the "pick from the whole insane list" might appear as bodyguards/units. So now the routine has a chance of giving you reasonable commander with reasonable troops assignments simply bosting the indeps defense, and a lesser chance of also tossing in a floating head with 3 monoliths guarding it and 5 titans as units.
The next level up on adding logic involves creating arrays which allow assigning based on land/water capability. The routine presently allows units to be assigned both land and water which "drown" in the first round of the game. Not too bad since it adds a possiblity of creating "empty" provinces.
Then the array might flag all units as commander, follower, god so that the Groups made more sense. You didnt have mages assigned as troops (wow, I have 15 guys in robes who attack with daggers) or not have a vineman commander leading an army of dragons. Or group them by type so that a dragon leads an army of dragons, and a titan leads an army of titans.
*sigh* there is more for the commander thing. Do you really want the whole list of my overly fertile mind? Much less the list for the castle/lab/temple thing, the indept/magic/sites strength, random sites assigning, logical equiping of commanders, etc?
Obviously this could get out of hand. Anyway the final vision for a total project might end up as involved as DomMap did. Listing all the possible features and giving a choice range from vanilla plain to completely insane.
[ February 27, 2004, 17:09: 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!)
|
February 27th, 2004, 07:14 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: RanGame (random game generator project)
I forgot the "empty province" thing requires adding a routing to decide if the definition of a province should start with a "#land" or a "#setland". Kindof fun playing with the differences there. With setland if you make someone the owner then they still have to fight the locals in the first round. That creates alot of sites all over the map where indepts might be already sieging a castle owned by an AI along with provinces that are free to take with no defenders
Also, if you add an "AI might own this" routine you can get strange results of starting the game and finding out that you dont yet own your own capital. Also a "must fight for it in the first round" situation. To fix it you have to add a #nostart for any province that you assign to an AI
[ February 27, 2004, 17:15: 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!)
|
February 27th, 2004, 07:16 PM
|
Sergeant
|
|
Join Date: Sep 2003
Location: Norway
Posts: 346
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: RanGame (random game generator project)
Quote:
Originally posted by Gandalf Parker:
*sigh* there is more for the commander thing. Do you really want the whole list of my overly fertile mind?
|
Yes, fire away. The fuller list I've got now, the better prepared I am to make a workable design rather than something that'll grow out of hand after a handfull of additions.
__________________
"Freefall, my old nemesis! All I have to do is activate my compressed gas rocket boots and I will cheat you once again! Belt control ON!…On?" [i]Othar Trygvasson[i]
|
February 27th, 2004, 08:53 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: RanGame (random game generator project)
I dont have a well thought out list actually. Since prior to this I had figured it would be all my own programming.
I figured that range of settings would allow for a reasonably logical game of randomly assigned AIs, maybe some alliances, one might have some starting boosts. And an insane setting would allow everything to be randomized and scattered to the max. Everything! A game which has a few random Groups chosen from the entire units list on a map with high independents and low magic sites would play quite different than a game with every province getting a random army played on a map with low independents and high magic sites.
I even considered the possibility of adding a randomizer MOD but Im sure that needs to be a seperate project for later (have every one of the 1087 units in the game entered into the mod with a randomly altered feature)
[ February 27, 2004, 18:53: 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!)
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|