Author Topic: New Colony Game  (Read 14704 times)

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« on: January 09, 2006, 05:36:36 PM »
Today i've started on a new colony-type game. It will follow the renegades story.
For some time i have been waiting to release the first Renegades pack into the outpost universe, but i've been asked to pospone that release until the next opu-reunion. I have honoured this request, but i have been waiting since october and i started to feel bored.

I know many people have tried to set up a simple colony game, but none of them have an AI running in it. I do not wish to brag or anything, but if someone knows how to set up an AI, it would be me, so i've taken it up to myself to create this.

I've decided to make it the same way i've set up the Renegades' story. To that end, it will be a surprise for all of you when it's done. I hope to have it done before the next reunion, so it can be included in the first Renegades release pack.


I'll try to keep this thread updated as much as possible without giving too much away about the game itself. So far, the basic set up is complete, that is: the game can now be played out, but there is no AI code yet.

Total time invested: about 2 hours
Total number of source lines: 391 (not counting previously designed files)
Size of dll script file: 84kB
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
New Colony Game
« Reply #1 on: January 09, 2006, 05:41:20 PM »
Sounds great :)

 
« Last Edit: January 09, 2006, 06:11:48 PM by Eddy-B »

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
New Colony Game
« Reply #2 on: January 09, 2006, 06:20:13 PM »
I can't wait to play it!

Does anyone know when the reunion/next release will be?

Offline lordly_dragon

  • Sr. Member
  • ****
  • Posts: 389
New Colony Game
« Reply #3 on: January 09, 2006, 08:55:55 PM »
i really dont know either ... could abe fun to know  :rolleyes:  

Running, scrambling, flying
Rolling, turning, diving, going in again
Run, live to fly, fly to live, do or die
Run, live to fly, fly to live. Aces high.

Offline wizisi2k

  • Newbie
  • *
  • Posts: 32
New Colony Game
« Reply #4 on: January 09, 2006, 09:37:06 PM »
u gonna do like u did with the first 4 missions and release beta's to select ppl to test it?

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #5 on: January 10, 2006, 06:21:51 PM »
Quote
u gonna do like u did with the first 4 missions and release beta's to select ppl to test it?
i might.


Today i worked only 45 mins on it. Mainly some testing to see if everything works fine.
Game gave an error when saved: that was solved. The last 20 mins i added a difficulty-selector to have the colony-game start in a different way, depending what difficulty was selected. Also made some basic coding structures to help set up the AI.
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
New Colony Game
« Reply #6 on: January 10, 2006, 07:45:47 PM »
Eddy I know you don't normally share your code but do you think you could share some AI coding stuff from the colony game?
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #7 on: January 11, 2006, 06:48:56 PM »
Quote
Eddy I know you don't normally share your code ...
then don't ask :P

-------------------
Update:

I've worked on the AI part quite a bit today. I've now got the AI do real research & development of it's technologies and structures. This will make the AI more real and lifelike, plus without using timers to fake research being this way of playing an AI is much more fair.

This is also the first real test of the IUnit::Research command.

Total time invested: about 10 hours
Total number of source lines: ca. 600 (not counting previously designed files)
 
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #8 on: January 12, 2006, 06:54:18 PM »
I worked some more on the AI
This colony game is helping me a great deal towards an independant AI library.

So far the AI can
  • build up its base;
  • research topics;
  • set up additional mining routes;
  • defend its base with GPs, using the latest technology.
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #9 on: January 13, 2006, 08:14:27 PM »
Worked all evening to getting the AI bases to randomize their construction.
Yet another step closer to a general AI.
If you've played the mission once, and you play it a second time, you'll notice that the AI places it's structures differently.
The code had a lot of bugs in it, so it took me while to get it running smoothly.

I've added extra items to the AI researchlist and set up additional tank groups. When i have a result on the objective poll i will complete the research list.  
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #10 on: January 14, 2006, 03:46:46 PM »
I don't even know if people are really interrested in hearing a daily progress report, but i'll keep posting until i get complaints :P

I had a setback with the AI building positioning. At times it crashed and it took me a while to figure out what was causing the crashes. I had to rewrite the entire positioning algorythm to what it is now.
After the modification the randomness became even better.

I'm now down to testing the whole thing, and to see if they build up their bases correctly time after time.
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
New Colony Game
« Reply #11 on: January 14, 2006, 07:10:18 PM »
Well were sure interrested in a new colony game! :D

Post updates by all means, start a wiki page for the colony game.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #12 on: January 15, 2006, 10:22:48 AM »
I find myself slowing down the AI to be able to have it beatable.
Not even the best player can keep up with the perfect AI, since the AI could start building new units the moment the SF/VF becomes available. Same goes for research. A human takes time to click (even the fastest amoungh you!)

So .. i'll just have to let it run a couple more times to see how it does its thing.
I'm getting very close to the general AI. All i need now is a tub/wall routing algorythm (i believe hacker made one), and a way to determine suitable buildingspots. OP2 already has a way to find out which location is nearest.

I'm pretty sure, the code i have so far is already more advanced then any AI code ever written for Outpost2. In fact the original code by Dynamix isn't much of an AI.

----------------------
My progress today:
Rewritten the rest of the building placement code. I am not using the original code anymore, as supplied by the SDK, but my own routines. They are more elaborate, BUT they can do a lot more!
I even have the AI earthworkers build tubes as needed. This eliminates the cosmetic problem of tubes laying open for 100's of timemarks before they are actually needed (if ever).

----------------------
PS: it runs beyond mark 600 without any problems. And i think it's pretty unbeatable by now :D
« Last Edit: January 15, 2006, 10:41:00 AM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline wizisi2k

  • Newbie
  • *
  • Posts: 32
New Colony Game
« Reply #13 on: January 15, 2006, 10:45:12 AM »
unbeatable? u better make different dificulty settings so that it CAN be beatable just not get rid of the code- but make it so on certain difficulty lvls the human player has a LITTLE bit more of an edge (ie more ppl on easy and a VF and ADV lab in SF)

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
New Colony Game
« Reply #14 on: January 15, 2006, 11:32:17 AM »
Great work :)

As i said for building locations, i think you should use a ini file for each map.

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
New Colony Game
« Reply #15 on: January 15, 2006, 11:34:09 AM »
Quote
unbeatable? u better make different dificulty settings so that it CAN be beatable just not get rid of the code- but make it so on certain difficulty lvls the human player has a LITTLE bit more of an edge (ie more ppl on easy and a VF and ADV lab in SF)
I agree.

I'd also like to see the "perfect ai" and watch Levi try beating it. or probably just watch two perfect ais fight each other. Of course I would only ever play easy.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #16 on: January 15, 2006, 02:39:44 PM »
Those are good ideas :)
I have slowed down research to give a human the chance to keep up. When research is slower than production it slows down the entire operation. Each difficulty setting has a reseach speed assigned to it. Obviously 'hard' is the fastest, but still much slower then it was before.

As time progresses, AI research will gradually speed up, the same it would with a human player creating more and more scientists.

---------------------
So far i've only been concerned with defensive units & base building. After that has been tested thoroughly i will start working on the offense.
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
New Colony Game
« Reply #17 on: January 15, 2006, 03:04:43 PM »
A human player can constantly pump out tigers from 6 different vehicle factories. More than six factories (MAYBE seven or possibly even eight if you are Supertypingman) are not needed as one of the factories will be done by the time you do all the hotkey'ing at the others.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #18 on: January 15, 2006, 04:28:03 PM »
got ur point!
for you, i will create a "HARD" version :D
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #19 on: January 20, 2006, 12:53:58 PM »
Time for an update:
------------------------

Worked on it a few hours over the week.  It's been a pain in the royal butt to work with MSVC, when you're a) used to C-Builder for so many years and b ) have to use C-Builder 8 hours a day for your job...

But anyway: i got to fix a few bugs that i still had, and tweaked the AI structure building code somewhat to accept even more settings. I've had levi test an early version of the game, and we both kinda agree on the difficulty settings, althou leviathan was complaining he didn't have anough scientists... oh well that's life!  You wanna play with more colonists to start with: play a multi game! :P


This week i've updated the AI to include attack code. I've had some enjoyable time watching the AI's beat each other up!
« Last Edit: January 20, 2006, 12:56:37 PM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
New Colony Game
« Reply #20 on: January 20, 2006, 01:15:52 PM »
Well whatevea the objective, population or starship its gonna take a long time to build up to that with the amount you start with, I only had 2 scientis on research by the time I had advanced lab, you very being the computer players, your gonna get overran prity quick and not be able to keep up.

But were c.

And y dont u just use C-Builder? :P

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
New Colony Game
« Reply #21 on: January 20, 2006, 01:18:43 PM »
Thats good, cous its more fun to start with very few ressources.

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
New Colony Game
« Reply #22 on: January 20, 2006, 01:24:08 PM »
Quote
This week i've updated the AI to include attack code. I've had some enjoyable time watching the AI's beat each other up!
Do you think you could make a multi map with the AI after you finish the colony game? Perhaps you are on a team with one AI vs. another team with an AI. Or La Corrida or Peacekeeper updated would be nice.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #23 on: January 20, 2006, 02:48:13 PM »
sounds like fun
i've been trying to set up this colony game as much 'general' as i can, so it can be used in other projects without having to change much. That's why i included so many new options for the base building structures.

As for levi's & TH300's remark: i also think it's more fun to start with low resources. I know you OP2-guru's like to have a quick game, without having to do much of the early researching.. and that's what the multi-levels are for.
The AI has no distinct advantage: it starts just the same way as the human player does, and i've managed to decrease the AI "cheat" level a lot! it does REAL research, and will not construct anything that it hasn't researched yet. I like a fair fight!
« Last Edit: January 20, 2006, 03:05:54 PM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
New Colony Game
« Reply #24 on: January 22, 2006, 11:24:46 AM »
I have rewritten most of the AI source file - resulting in 100's of errors that needed fixing. That took me the better part of an evening.
The result: a more readable/understandable source code package, so i can still use it after a year or so, without having to read thru my own code for days before it starts making sense again.


I've also redone the tube-placement code. Made it more economic. The old version placed tubes from center-point to center-point, while the new building that would occupy the spot would be placed on top of tubes that were just built. Now the code takes in account the size of the building when placing the connecting tubes. Still not 100% of the way i would like to see it, but it's a considerable improvement.  I know .. the 50 ore a tube costs won't bother the ai much, but when the earthworker is building the tube(s) a convec cannot build in that spot until the earthworker moves away. Outpost 2 has standard code that moves out any friendly unit when a new building needs to be placed, but that doesn't apply to a unit currently involved in construction of its own (including tubing).
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz