.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Assault Task Force- Save $8.00
Bronze- Save $10.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old June 6th, 2005, 10:48 AM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: New Map Utils For Dom2

I have also considered making an Applet out of it, so that you could choose the parameters for a random map to a server. It would still need the 100+mb download of Java Runtime Edition.
Reply With Quote
  #2  
Old June 6th, 2005, 12:21 PM

The_Paladin The_Paladin is offline
Private
 
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
The_Paladin is on a distinguished road
Default Re: New Map Utils For Dom2

My utils have no GUI component at the moment (and probably never will since they are quite a few options especially in the later two that would prove extremely time consuming to guify). Also since the functions I use are Windows console functions they are essentially all old DOS routine type stuff that is emulated or has equivalents under Linux / Unix (like printf, fopen). So I don't see OS compatibility as being a problem.

To Endoperez, Gandalf and anyone else who is interested I would be happy to help if I can with your projects. For anyone else who does not care about programming please feel free to skip this - you have been forewarned .

About Java - I do know Java though I don't much care for it... Its very similar to C++ though just lacks the performance I need for my RL work. I would hesitate to use an applet for the reason you have suggested - the massive download and for the operations you need they are fairly portable from machine to machine unless you are intending to provide a GUI component in which case then yeah there will be some issues with compatibility.

Its been a while now but I believe if you use regular interpreted Java you can often embed a small version of the interpreter inside the executable. Depending on how fancy the functions are you use, the required interpreter is often small enough to offer downloads with. I believe also that MS's J++ or Borland's... something or other that escapes me... they allow you to create a Intel compiled version as opposed to an interpreted version. I remember doing that once. That should allow your program to run on anything save Macs. You might not want to shell out the large dollars though for J++. Worse case scenario though most simple Windows-based Java programs can be readily converted to C++ with only changing the entrypoint function and a few function calls. Before I start rambling too much though I better move on.

The readme.txt file gives a little more info as to how I formed the blocks but in more detail essentially Gandalf is mostly right. I use arrays of two structure types, Province and Nation, which contain:

Province:
TerrainType
Available
NeighbourArray

Nation:
TerrainType
OwnedProvinces

Procedure:

1) Create an array of provinces by reading in the #terrain statements from the .MAP file. That also allows me to detect their type so the water nations can be put below the sea. I set the terrain type and available flags in the province structure appropriately.

2) Search again the .MAP file (technically this is done within step 1 but for clarity I separated them) for #neighbour statements. For each such statement, add the neighbour province to the other province's NeighbourArray. For example if the statement was #neighbour 3 12, province 3's neighbour array structure would add province 12 and province 12's structure would add province 3.

3) For each nation participating on the map, I randomly choose a province (generate a random number and choose it). I make sure the nation's terrain preference matches the selected province (water for water, land for land) and if so add that to a list (or array) of the nation's owned provinces. Within the province structure, I now set the available flag to false. If not just repeat until a match is found.

4-a) Again for each nation create a list of current neighbours to the owned provinces. This is the key to forming the blocks. That is accomplished by examining the current list of owned provinces the current nation and forming a master list of all potential neighbours. For each owned province, all members of their individual neighbour list are added to the master list. Essentially it is the union of the owned province's neighbour sets. Duplicates are fine as I will deal with them later.

4-b) Taking the master neighbour list, randomly (random number) choose a province amongst them. If that province is available (i.e. its flag indicates that it is), then add it to owned province list and mark it as unavailable. If not repeat step 4-b until a province can be assigned. Once a province is assigned return to 4-a until all additional provinces are assigned for that nation. Then repeat for all other nations.

That's it essentially. I've left out some details that would detract from the point but essentially this is it. Oh and about duplicates in the master neighbour list. I like them as they occur only if more than one owned province neighbour the same un-owned province. That encourages creating blocks of provinces as opposed to a snake like shape. And its ok to add provinces to that list that are already owned by someone, as the available flag will not be set.

I think this should answer your question but if its not clear just let me know. Sorry for the math / programming - I'm a grad student in the middle of writing my PhD thesis so I'm kind of used to writing like this these days.
__________________
-Paladin
Reply With Quote
  #3  
Old June 6th, 2005, 01:06 PM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: New Map Utils For Dom2

Yes, I think I understand that and that will be of great help if/when I get going. I'll have to check few things about portability first, it seems. I had thought some general Java library worked on all platforms Java worked on, but it seems it might not be so.
Reply With Quote
  #4  
Old June 6th, 2005, 09:48 PM
NTJedi's Avatar

NTJedi NTJedi is offline
General
 
Join Date: Jun 2003
Location: az
Posts: 3,069
Thanks: 41
Thanked 39 Times in 28 Posts
NTJedi is on a distinguished road
Default Re: New Map Utils For Dom2


The_Paladin... these tools sound awesome !

Where can they be downloaded ??
Does a readme file explain how to use them ??
__________________
There can be only one.
Reply With Quote
  #5  
Old June 6th, 2005, 11:02 PM

The_Paladin The_Paladin is offline
Private
 
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
The_Paladin is on a distinguished road
Default Re: New Map Utils For Dom2

Quote:
NTJedi said:

The_Paladin... these tools sound awesome !

Where can they be downloaded ??
Does a readme file explain how to use them ??
At present you can download the first of the three utils as an attachment to the first post in this thread. There is a readme file in the zip which explains how to use that uitl. However I am presently modifying the last two to accept input from config files. At the moment they require code changes to alter their configuration and that is obviously useless for the end-user. I anticipate having a beta of the three tools out sometime this week along with an instruction manual of sorts so stay tuned .
__________________
-Paladin
Reply With Quote
  #6  
Old June 7th, 2005, 05:50 PM

The_Paladin The_Paladin is offline
Private
 
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
The_Paladin is on a distinguished road
Default Re: New Map Utils For Dom2

Thanks to everything going well, a trick I thought up, and a very nice unit database by Edi (Thanks!!!!), I was able to complete my work much earlier than I expected to.

The Dominions 2 Genesis Forge Pack Utilities Version 0.7 Beta is now available for download as an attachment to the original post.

I have managed to complete all three utilities to the point at which I'm comfortable releasing them. To those few who have downloaded the original attachment already you might as well erase those files and re-download as significant name changes have occurred since the original release. Sorry but I had to change things up to avoid name conflicts and confusion with other utilities.

Utility 1 has been given the name Genesis Map Mod (GenMM) and matches the functionality described in the original post.

I have combined utilities 2 and 3 into a single utility called Genesis Game Mod (GenGM). This utility, due to random elements and large game impact, is very difficult to test though I have confirmed much of its functionality I am almost certain that some bugs must remain. It meets much of the functionality described in the first post but not all. It is still quite useful in its present form so do not let that deter you. I am just letting everyone know that there are still more things to come (though not for a little while at least as I'm getting rather busy around here).

I have tried to provide as many options to the user as possible in GenGM - that reads in other words that there are some things to learn / configure unfortunately. For the avid modders out there, a quick read of the text files will likely have you up and running. For the non-modders I would suggest a careful read of the text files. Stick with it - same as learning Dominions 2 in the first place... it takes time but I hope it will be worth it . I wrote the utils and I still find myself referring to my own documentation so there are a few things to remember.

Also for GenGM, I have essentially implemented a small tag based scripting language to alter the settings. Of course I can use it as I just wrote it but that doesn't mean much . I need people who do take the time to try this to please give me some feedback. Did you understand the text files? Is there more info needed? Would alternate commands be helpful? That kind of thing.

Similar for bugs. If you notice something out of the ordinary, let me know that too as I'm sure there's at least one or two ones left somewhere.

Also for future ideas / expansion of the scripting language. Recommendations are welcome. What other abilities / commands would you like to see implemented? If they are feasible and people generally like the idea I'll likely add them at some point.

For installation notes read the zipped file, "Dominions 2 Genesis Forge.txt". That should guide you through everything.

And for those wondering why I called the util pack the Genesis Forge... well read the text file and I've tried to give a creative story as to why . And on that note, I hope Zen doesn't mind but I used his removal of wish in his spell mod in that story. It gave me the idea for the name.

If you develop an interesting GenGM.CFG file, they are compatible so you could post it here for others to download and try without having to learn to write CFG files themselves.

Personally one of the things I like to do, as I think +luck is next to useless as the game stands, is for any pretender who takes luck picks give their nation 1, 2, or 3 random extra abilities from a set I've defined making it much more profitable. If you take luck, for example, and gain a recruitable vine ogre, or a supplybonus, or cold resistance - it makes it worth while.

All right... that's it - go forth and enjoy!
__________________
-Paladin
Reply With Quote
  #7  
Old June 7th, 2005, 07:25 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 Re: New Map Utils For Dom2

there was a 3rd party util request thread around here somewhere with alot of unfullfilled wishes
__________________
-- 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
  #8  
Old June 20th, 2005, 11:09 AM

PDF PDF is offline
Colonel
 
Join Date: Apr 2002
Location: Near Paris, France
Posts: 1,566
Thanks: 0
Thanked 0 Times in 0 Posts
PDF is on a distinguished road
Default Re: New Map Utils For Dom2

Bah, we could spare some headaches if the shortened description were padded with blanks (/20), isn't it ?
Reply With Quote
  #9  
Old June 20th, 2005, 11:20 AM

The_Paladin The_Paladin is offline
Private
 
Join Date: Jul 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
The_Paladin is on a distinguished road
Default Re: New Map Utils For Dom2

Indeed! I never thought of that but it may indeed be an option . If we pad both sides of the name strings with relatively the same number of spaces they will remain centered on the screen in the descriptions and yet also remain the same size.
__________________
-Paladin
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 11:23 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.