.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Scenarios, Maps and Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=146)
-   -   Perking up the AI (http://forum.shrapnelgames.com/showthread.php?t=42307)

Ballbarian February 23rd, 2009 03:20 PM

Re: Perking up the AI
 
Quote:

Originally Posted by VedalkenBear (Post 676252)
If someone could explain the underlying logic of SemiRandom, I could try programming it in Java.

I would have great sympathy for anyone trying to follow SemiRandom's code. I am usually a very disciplined programmer and a stickler for meaningful variable names and verbose documentation, but when it came to this project I really just started typing until it worked. Then I added some more spaghetti on top of that lumpy mound. What a mess. :p

The RanDom front-end is not so bad on the code side, but I left out a ton of much needed error checking and the like. That is what happens when you don't know where you are going until you get there.

llamabeast February 23rd, 2009 06:47 PM

Re: Perking up the AI
 
I understand that Python is mega-lovely. I'm a big fan of Perl, and apparently Python is nicer.

http://xkcd.com/353/

Gandalf Parker February 23rd, 2009 09:07 PM

Re: Perking up the AI
 
Quote:

Originally Posted by VedalkenBear (Post 676252)
If someone could explain the underlying logic of SemiRandom, I could try programming it in Java.

Here is the original page from the old Dom2Minions site.
http://www.dom3minions.com/~minion/SemiRandom.shtml

The program is based on the fact that map commands allow much more management than most maps use. Some, such as Faerun, have programmed provinces with logical population choices, defenders, magic sites, name, etc. Those are great (and way too few) but the pro and con is that there is some loss to replayability. My totally chaoticized maps are called "interesting" but they can be irritating in the total lack of logic in what it throws into the map.

This projects concept is allowing all players to design a province. Such as: "The Shire" with a population of hoburgs, magic sites boosting supplies, and some interesting defenders. These are converted to Dom3 map commands and placed in a file where the name of the file includes codes to specify something such as "farmland" to control its placement.

So the SemiRandom program reads a map file and randomly places these planned provinces. You can tell it the percentage you want as designed vs being left to the games randomizer. As SemiRandom reads the map file, if it finds a farmland province then it chooses a farmland file and inserts it there. When it writes out the modified version of the .map file there will be special provinces included.

Thats the basic of it (pun intended). Of course Ballbarian has added wonderful extensions. The @ sign allowing for a small list so something like the guards equipment or name can be randomly selected from a short group of logical choices. And recognition of special provinces such as island, lake, peninsula, volcano, cave, etc. And lately the ability to add pre-designed logical gods/scales for AIs

The effectiveness of the program depends on having many pre-designed provinces and god files. Enough that we dont seem to keep running into the same things over and over. I think we are getting close to that but Id love to see more people turn in some so we can get more variety.

Gandalf Parker
--
The Socializing Soloist, the Mad Mapper and the Minimalist Modder, the Lord of Chaos, the Prophet for Random, Experimenter of Extremes, He Who Will Not Normalize Standardize Specialize (or Finalize), He Who Public Domains All.

JimMorrison February 23rd, 2009 11:13 PM

Re: Perking up the AI
 
I think what SemiRand really needs (borrowing from the rest of the winding journey of this thread), is a browser based designer. So for example, a page on the dom3minions server might have the same dialogues that are currently found in the downloadable exe, but the overt ease of creation and submission could likely spark a deluge of submissions - I am thinking that many people don't want to bother with it all for 1-2 provinces, but if all of those 1-2 province people were cajoled into submitting through the webservice, it would hugely magnify the number of available provinces.

lch February 24th, 2009 07:26 AM

Re: Perking up the AI
 
The main problem that I have with web services is designing forms. I hate design work. :) I haven't yet found a good way to be able to just code and have forms for user interaction generated automatically, without using an overblown framework that tries to abstract the whole thing with MVC, forcing you to jam your logic into their structure and using their database abstraction instead of giving direct access to these kinds of things. I have in mind to get a web version of catgod, maybe I'll find something for it.

VedalkenBear February 24th, 2009 08:22 AM

Re: Perking up the AI
 
JM: (OT: Thanks for switching your pic. I love that lolcat.)

Piggy-backing on your idea, if we had such a framework (and that shouldn't take much; I'll look into it) we could set up a 'pay-to-play' service where someone to use a MP server for a game had to contribute a province to 'the file'.

My OOP class was very big on knowing how to format text correctly, so I'm fairly certain I could write a Java app that could take this information and format it for SemiRandom.

Gandalf Parker February 24th, 2009 11:44 AM

Re: Perking up the AI
 
Im not so much an old programmer as I am an old internet admin. I was part of the early protocol discussions. So its not the programs, or what they are written in, which concerns me.

We can have a ton of apps. But I think that we should try to do is come to agreements on formats. The DomMap project developed some agreements on how .maps should be annotated. Some of that was carried over to the SemiRandom project. And some of the future developments for SemiRandom are most likely to use Edi's spreadsheet format as a database.

If all of the apps use an agreed on format for the province adds, god builds, sprites, etc then we can share libraries. And use data files which use Edi's spreadsheet, or at least an export from it, so that the apps stay current easier.

We might want to start an RFC thread on it. Actually the format of the province and god adds might be reaching a limit. The "appropriate" tags might want to be shifted to the first line of the file rather than the file name but thats something Ballbarian would have to agree to (but I could automate the file changes).


Gandalf Parker
--
The Socializing Soloist, the Mad Mapper and the Minimalist Modder, the Lord of Chaos, the Prophet for Random, Experimenter of Extremes, He Who Will Not Normalize Standardize Specialize (or Finalize), He Who Public Domains All.

Gandalf Parker February 24th, 2009 06:50 PM

Re: Perking up the AI
 
Well Ive put in a fairly full day.
I know I dont finish many of the other projects but if no one shows an interest most of them just sit in the "who cares anyway" list. :)

But the server stuff I do better with. I have now added a new game type for SemiRandom games.
http://www.dom3minions.com/HostedGames.htm

Gandalf Parker
--
The Socializing Soloist, the Mad Mapper and the Minimalist Modder, the Lord of Chaos, the Prophet for Random, Experimenter of Extremes, He Who Will Not Normalize Standardize Specialize (or Finalize), He Who Public Domains All.

das123 February 25th, 2009 12:38 AM

Re: Perking up the AI
 
Quote:

Originally Posted by Ballbarian (Post 676213)
Can anyone recommend the direction of least resistance for an old windows user who started programming in basic on an TRS80 back in the early 80's and now is stuck in VB6 for his GUI needs? Don't get me wrong, I love VB as it is much more powerful than it gets credit for and allows me to generate fairly complex solutions quickly and painlessly for work. I just wish I could compile my work as a functional web page or something along those lines. Guess I should take the time to do some more research. Anybody familiar with VB6's web programming features?

Man, you're kidding! That's exactly how I started. The old TRS80. Progressed from basic to machine language (or whatever it was called). Ever since Object Oriented Programming came out I've had a difficult time working with classes and thinking in a non-linear way. :)

I split away from the MicroSoft programming languages in the late 90's when the power of PHP blew ASP out of the water. Never dabbled much in VB, .NET, ASPX etc since then.

The Dom3Bak utility I wrote was in Python because I wanted to see the power and ease of it. I'd certainly recommend it as an easy way to program. I'm guessing Java is closest to VB and C++ but I never spent much time with that language. Most of my coding work is still PHP.

I'm guessing that if you are wanting to bring your VB code to the web you would need to construct the GUI in ASPX with .NET and then use your VB code to power it.

As far as adding to this discussion about bringing programs like SemiRandom to the web, the hardest aspect will be to build the maps through Dominions3 and distribute them. Needs a lot of grunt and then the distribution files will be large. It seems that the rest of the process is essentially manipulating and compiling text-based data - which would be the easier part to build.

There could even be randomising rules built into the config files to help mix things up a bit. Eg. Percentage chance for a certain sorcerer to be in the province or random number of troops between a designated min and max.

Gandalf Parker February 25th, 2009 12:45 AM

Re: Perking up the AI
 
In a way, there is. The @ sign in a SemiRandom file designates a random selection. So you could designate the number of troops to be an @ list with 10, 20, 40, 60 troops to select from.


All times are GMT -4. The time now is 12:25 PM.

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