How would you like to change civ?

InnateGamer

Emperor+2
Joined
Jul 30, 2011
Messages
48
I'm currently working on a turn based civ like game and I've got to the point where I need to make some design decisions (which is early in the project). My goal is to make a game that can be easily modded, I'm going to avoid hard coding units, improvements etc and put them in an editable text file instead. The AI is almost definitely going to be better then in the original game, that's the main reason I'm doing this. I found myself playing on emperor+, on difficulty 5 or 6, or even "0a", but it didn't provide any challenge, except on the really hard difficulty levels, but the AI was so stupid that it kind sapped my gaming experience.

One of the things I hope to achieve with better AI is that it will "feel" the changes in the game rules. For instance if you make a granary 10 times more expensive a bad AI might attempt at building it anyway, and then just wait until it gets finished, a better AI would somehow "see" that the granary is too expensive. And if you took away the benefit of the granary and made it a useless improvement a stupid AI might still build it. By making the AI better it will be easier to change the rules of the game without making the game imbalanced, maybe a more expensive granary could still be worthwhile if built later.

Tell me what kind of changes you would like to be able to make, I know that I definitely would want to be able to edit the research tree, units, improvements, but what more? The likelihood that various leaders go to war? The effects of city improvements, perhaps there could be a city improvement that made the city treat grassland squares without shields as squares with shields? I'm sure there's a lot of people who've played this game endlessly, like I have, but sometimes wished they could change something. I learnt how to change the difficulty level beyond emperor on this forum, and I think that the map editor is awesome, but I never used it (does it only work for civ-dos perhaps, iduno).

Anyway, I have decided that the best way to make changes is by reimplementing it from scratch and I just got my lalr(1) parser generator to work, although it's a little rough around the edges and could use a cleanup, but anyhow I'm able to make parsers now so I'm going to develop some kind of language that could be used to generate the rules. I have ideas of my own, but I really hope that by starting a tread about the subject more ideas will be shared, I'll consider all the ideas and try to generalize them and try to come up with something that feels "complete" and yet not bogged down with details or overly complex. If this project goes well I'm planing on doing a Warlords like game after this. Warlords (Warlords 1, not the civ game) is much less complex than civ, so modding doesn't apply to it in the same degree as it applies to civ, but I'm doing it for the same reason because I thought the AI was too bad.

edit:
Now I've uploaded an online version of the terrain generator. It's still really "rough around the edges", but if you'd like to try it out and tell me what you think. (It takes a few seconds to generate terrain, but I think it will be faster, just wait a few second after you click the button, hmm, oops, btw don't click the button more than once):
http://innategamer.tk/
I realize a terrain generator is far from a complete game, but I'll keep working.
 
Great, I've been waiting to someone make a post like this.:)

I'd like to see the following changes:

1.Push the limits. Allow more civs in game. I would set the maximum at least four times the current we have (7). That would make it somewhere around 30 civs. Also allow bigger maps.I believe that around 160x100 maps would still be playable.Higher maximum number of cities and units. These changes are must to have IMO.

2. Make it customisable. You said you are going load for example unit stats from text files.This is the way to go, I agree. Propably majority of people who play Civ want to change something. So - I would at least make terrain-, unit-, improvement- ,building-, wonder- and govenrnment attributes to be loaded from text files. Just everything :).
New items should also be possible to add to game.(For example adding new unit).

3.Fix the bugs and exploits. I've never been fan of "We love the leader day". This feature makes population growth too easy and makes Granaries useless. I would get rid of this or change its function.
Add production overflow of somekind.The current system in CivDOS (maybe CivWiN too I don't remember) requires some boring micromanagement if you want to make best out of your cities. No settler cheat or railroad on water!(But you could allow players to edit game so that rails on water are possible.)

3. Map and Scenario editor. At least I do enjoy to create scenarios.

4.Try to make AI fast enough. I hate waiting minutes while CPU is processing AI moves. This is quite important, in my opinion!

5. I really like the Civic system in Civ4. Maybe replace Governments with Civics?

6. Maybe keep blog of what you have done and what you are doing?
Would be nice to see the progress of the project.

Well , here was some broad ideas I have. Of course I have many more detailed ideas too, but if you make the game customisable, it's not necessary to list everything.
Btw, are you going to freeware? And are you going to use original graphics (DOS or Windows version?).Possibly open source?
Anyway, good luck with programming!
 
OK thanks for the input so far. I've been struggling with the AI today, this project is going to take quite some time and I've never done a project this size, so please be patient, I excuse for the tardiness in advance (it's not like it will get finished in a mere couple of weeks, it's taken me about a month so far). I feel confident it should be possible to make an AI that's better than in the original though.

Anyway, addressing the input in order from above:

Determining how many years should pass should be easy, one interesting problem is if there's supposed to be only one year between 1BC and 1AD. 0AD would look weird, but maybe that's just me, I'll try to make everything easy to change.

I've been reading about terrain generation algorithms online, there's nothing that prevents the map from being bigger. As for the number of civilizations I wonder how one would tell them apart, as for the sprites of units I was thinking about having image files with transparent pixels, and then just set the transparent pixels to the background color of the civ and make it possible to specify background colors for various civs. Perhaps if the background colors are the same for two civs those couldn't exist in the game at the same time. That way I wouldn't have to know how many civs there would be, but changing the number would also require specifying colors for them. As for the units, tech, improvements, wonders, terrain improvements they would all be read from a file.

A map/scenario editor for placing units, terrain, editing cities and so forth is a given.

4. This is an interesting point, because you talk about performance. I was thinking that I should generate a new kind of save file that keeps track of the progress throughout a game. Say that you play 100 turns, save, then come back and decide that you want to go back 20 turns and choose different actions to test if the game would have worked out differently, you know the what could have been scenario. Anyway, normally if you didn't save 20 turns ago you would be out of luck, maybe you had a save that was 30 turns ago, then that would have to do. But what I'm going to implement is a save file that records the beginning of a game, including seeds to random number generators, and then keeps track of all the moves and basically just replays until that point, that way I hope to make it possible to come back to a game at any point of time. However, in order to discourage cheating the save file would keep track of the "canonical timeline", so if you go back and do something differently and then end up winning you would get an indication that you went back and won, and didn't win without going back to a previous point. The main idea with having all of the saves from one game stay in the same save file is to reduce the number of save files and make it easier to manage. The way this is related to performance is because the game would be playing itself up to the point that you chose to jump to from the nearest point in time when the whole state of the game was saved, if the AI was slow this would probably be when that problem would be the worst. I'll try to make the AI fast. Another thing one usually has to wait for though is for the AI units to move, if the AI has hundreds of units this could take some time. Perhaps there could be 3 different setting: 1. watch the AI move it's units one by one 2. watch units move many at a time if they're on the same screen 3. don't watch the AI move it's units

5. Or expressed another way have several governments chosen from different categories, so one could just add a government category and some governments, like free speech or mandated speech, in that category. One thing that comes to mind is if the choice of government in the various categories would be dependent on each other, like lets say there's two choices that go well together, like say democracy and free speech, but are not equally strong one by one. I think I could have the AI evaluate the value of each government choice in each city, to see how it affects things, but evaluating all combinations of governments in different categories might be to much work. I'm no AI guru, I can't do advanced stuff, but even if the AI was at a slight penalty for missing some particular combination of governments I guess that would still provide a good game experience.

6. I kinda have a blog already, but I havn't made any posts. I guess I'm kinda chicken thinking that I perhaps shouldn't say anything about what I'm doing, I may end up failing after all, or doing something stupid or unnecessary. But on the other hand maybe having the blog would increase my motivation, I just hope I wont say anything stupid.

Yes, I'm going to make it freeware, and then I'm going to make a Warlords clone. I have a really good game idea, a whole different kind of game than civ, I won't tell anyone about it yet, but it's this game that I want to make, that game is not going to be freeware. Civ is just something I'm doing to kinda practice a little at a big project, and also because the other game that I really wanna make involves too much art and is just really hard to develop. I have to make something easier before I make my dream game, but civ is turning out to be quite a lot of work too. My langauge is Java and I'm going to try to make it a dragable applet, that's an applet that runs in a web browser and can be dragged onto the desktop, that way there wouldn't be any "installing" the game. But if that doesn't work I think I'm just going to make it an executable jar, in any case it's going to be implemented in Java. As for the graphics I'm just going to make some simple placeholder images that can be replaced, if you wanted to make a new unit you would have to make a sprite for it anyway. The sprites will not necessarily have to be the same size. I don't know about open source though, I mean I've got some ugly code, so I don't know. In any case I've never been good at working in a group, I'm kinda a loner, not the kind to start projects on sourceforge.

Now I kinda don't know what to do next, let's see I have finished the parser generator, so parsing text files can be done, I've already previously implemented the code that displays sprites, including zooming in/out, it can zoom in/out in incremental small steps, I made it generic so that you could zoom an arbitrary amount, not just, say, half the size or double the size or anything like that, I don't know if that's going to be important later or maybe zooming is not something that people prefer at all, i don't know. Uhm, so, I guess now all that's left to do is... pretty much everything, let's see there's the city management/domestic AI, the defense AI (I think I'm going to try to do some zone of control thing that uses counterstrike units to take out units that comes close while staying out of reach of enemy units, think catapult in a forest or chariot on a plain and defensive units too, I've never done anything this advanced but I think I know how it should work), the attack AI (when attacking most units are probably exposed to attacks from counterstrike units, so I think a wall of defensive units moving forward would be the best way to go, possibly with some fast attackers behind them to take care of the defenders defensive units, again it's a first for me, but the AI in the original was so poor, at least all units should move together when attacking, not one by one), the central game logic (the glue that holds it all together), multiplayer, various screens (like city screen, diplomacy and so forth, this is probably going to take some time and look like crap, I am not an artist, as much as possible I'll try to make things customizable but I just don't know how I would enable a menu to be fully customizable), things I havn't thought about yet because I know there's probably some stuff I havn't thought about yet. Yes, there are some things I probably havn't thought about yet, and probably wouldn't have unless I actually tried to implement a game, yes I should have a blog. There this blog I use to follow, it was called "viridiangames" but he changed the name to "gamedevdad" a while ago, oh, wait (*face palm*), you know what? The reason I'm doing this whole thing was actually because I wanted to have a game development blog, but I didn't have anything to fill it with or make posts about, but then that position gradually changed into keeping things secret because they might not be good enough, somehow I managed to forget that I wanted to have a blog all the time, but the blog is actually all but finished, all I need to do is clear out the place holder posts that I used to customize wordpress and make a post.
 
Simple question here;
what programs do you use to change the game?
I'm pretty good at teaching myself skills and computer stuff, and I'm interested to give this a go.
So what can I download to get me into this?
 
I'm implementing it from scratch, I just use plain Java. You can download the jdk from oracle.com (used to be sun.com, I think they changed their name or something). Anyway in order to learn to program I just learnt to use collections and then I've just been googling a lot, reading stuff from gamedev blogs and such. Maybe I should start my blog, it would provide some extra motivation.
 
I've been struggling with the AI today
Wow, you are already working with AI:goodjob:

I remembered one thing. In my own poor attempts to clone Civ1, I have changed Civil Disorder functionality a bit. In Civ1 good and careful player never lets city to fall into civil disorder. I made it so that when there are more angry people than happy, instead of instant civil disorder there is a certain propability that Civil disorder will occur. I used following formula : P = (angry-happy) / CitySize. When city goes into civil disorder all production and trade would be halted and there would be risk of rioting (building destroyed).
Not sure this would make game any better or if that formula is perfect. But I just like the idea of possibility of take a risk of Civil disorder.Programming AI to consider that risk could be harder too.

On the other hand checking every city every turn is real pain. So maybe a good civil disorder warning system would be good idea too. In civ4 there is no civil disorders, unhappy people just stop working, not a bad way to go either.

Just a silly idea of mine...
 
Wow, you are already working with AI:goodjob:
I've just been thinking about the AI so far, I havn't fully figured it out. I want to figure out how the AI is going to work before I decide on how the basic game mechanics are going to be implemented, this is because the AI first of all of course needs to play the game, but also because when I decide on how the basic mechanics of the game is going to work I'm also deciding on how the game is going to change, or within what frame it's going to change, and the AI is going to have to be able to adapt to that. One problem is having a boat that must end it's turn adjacent to land or risk getting lost, that still applies that it could risk going further to find land, otherwise having to end a turn somewhere still leaves a lot of possibilities. The trireme might be needed to find continents, or maybe not depending on map type. I think I've found a certain technique to deal with certain issues that come up, but I don't know yet because I havn't implemented it yet. Anyway, the AI kind of should be figured out before the frame work of the game mechanics can be decided on, so it's kind of early in the project still, I've just chosen to design the AI early. While I'm working on the AI I sometimes get too ambitious, but then I realize that I'm not an AI guru and that it just needs to be a working AI. In the original the AI wouldn't be able to take a single city no matter how many units it had because it kept sending them one by one, sometimes even in a huge stack that could be eliminated in one attack. Or it failed using counter strike units. I think it should be easy to make it a lot better than this, and the ideas I have should be able to do just that. I'm not knocking the AI guys at, whatever the name of the game developing company these days, but I think the problem is that the AI of Civ was never good and even if they claim that AI has been improved, I mean even if the AI was improved the game has meanwhile probably got a lot more complex faster, the AI, even if improved, has never been able to catch up to the complex game that the Civ series has evolved to. By making a good amateur effort at a decent AI for a simple Civ it might be possible to get a game witch could be challenging sometimes, this is my goal here. The thing that made Civ 1 less complex than Civ 2 was that there were no hit points in Civ 1, no healing back to full health again. The thing that made Civ 2 less complex than Civ 3 was that there were no bombardment in Civ 2, although perhaps a really good AI for Civ 3 would be to just use the stack of doom to kill everything, but maybe that would hurt the fun in the game. Civ 4 added lots of complex upgrading possibilities and so forth. City management hasn't become more complex I think, that's the easy part.

I remembered one thing. In my own poor attempts to clone Civ1, I have changed Civil Disorder functionality a bit. In Civ1 good and careful player never lets city to fall into civil disorder. I made it so that when there are more angry people than happy, instead of instant civil disorder there is a certain propability that Civil disorder will occur. I used following formula : P = (angry-happy) / CitySize. When city goes into civil disorder all production and trade would be halted and there would be risk of rioting (building destroyed).
Not sure this would make game any better or if that formula is perfect. But I just like the idea of possibility of take a risk of Civil disorder.Programming AI to consider that risk could be harder too.

On the other hand checking every city every turn is real pain. So maybe a good civil disorder warning system would be good idea too. In civ4 there is no civil disorders, unhappy people just stop working, not a bad way to go either.

Just a silly idea of mine...

Not a silly idea at all, although of course normally cities shouldn't be in civil disorder because it almost always makes more sense to use an entertainer or something like that. Let's see here, what changes could be made, the effects of the status of the city could be changed, like civil disorder -> lose all production or trade, or civil disorder -> make city easier to bribe or something, or civil disorder -> destroy improvement with certain likelyhood as you suggested. I don't think those changes would make the game more complex, one thing that would make the game more complex and challenging for the AI would probably be the rule civil disorder -> units supported from city get worse stats, that would be horrible because it would couple the city management AI with the unit AI, and it would change the design of the AI, the other changes wouldn't change the AI the way I'm figuring it should work.

Let's see, I wrote something about my cactuses earlier, but I can't find it, I must have deleted it, anyway, I've been putting so much effort on this that I've forgot to water my cactuses! They deserve water! Well, this time I won't forget. Oh, my blog is now officially in business, I'll try to start writing a post every now and then, communicating about the project helps me stay on track as it were. But unfortunately I'm not very good at writing, and today it's too late I'd come of wrong being tired and all, so I'll have to do that tomorrow.
 
A flood of thoughts come to mind upon reading your post. My first advice is to write a detailed specification. The graphical representation of your world is a project in and of its self. I think if I did this I would program a game that appears to be a multi player game but as I wrote the user interface I would write the subroutine calls so that my AI code could use the same commands as the human player, but of course through program calls. In this way you could avoid imbedding the AI code into the heart of the graphical representation. So that when you discover your approach to developing an AI is inadequate you will easily be able to redo the AI module of your code without disrupting you user and graphical interface code.

The user interface of CIV Dos would not require an inordinate amount of time to reproduce. But an AI and an adaptive one at that, I can’t imagine the amount of man-hours necessary.

An external quote from a paper entitled Game AI for a Turn-based Strategy Game with Plan Adaptation and Ontology-based retrieval. (Pennsylvania State University)

Developing game AI, i.e. the algorithms that control Nonplayer Characters in a game, is well-known to be a difficult problem. Three outstanding challenges contribute to this difficulty. First, game developers have little time allocated to develop game AI; other aspects of game development such as storyline, graphics, and network connections usually take precedence. Second, the development of environments, called level design, is typically done independently of the development of the game AI….Third, games change over time. As games are tested, the games are tweaked to improve the gaming experience of the player. This makes constructing effective game AI a moving target.

Link to paper Note:file is a PDF

also look at these


Giving the AI a set of goals, codifying a set of logical rules for each, seems monumental. I can understand why the AI in CIV DOS just seams to harass the human player. The only goal that comes to mind is the space ship launch.
 
Yeah keeping the AI independent from the code that displays the sprites is how it's supposed to be done, actually I am going to implement multiplayer and maybe "save player", that's a new term that I just made up, but you'll see eventually (well, if you decide to read my blog), I havn't written about that on my blog yet, if this sounds like incoherent thoughts that's just because there's a lot of thoughts in my head right now and a random set of them just came out.

I disagree with the article that something can be called hard just because one takes too little time doing it, but the thing I disagree with most is how that sentence focuses on how "they" do it. There is no "they", one can use little time or much time, everybody can decide how much time to use. But anyway, does that mean that the AI of civ is bad because they had to afford other stuff like art and all that bull crap about leaders speaking in their native voice and all that stuff, boo, I wonder if there are any actual fans of civ involved in making those decisions, it doesn't sound good. Hopefully the article wasn't talking about... Firaxis? 2K? Whatever their name is these days.

I'm working on the terrain generator now, so pretty soon I'll have something interesting to post on my blog, only problem is I got no readers. But I guess that'll change. I've read an awesome article on the web about how to grow continents from seeds, I think most various terrain can be generated in a similar way. I've been a little lazy today, hey it's Saturday! But I shouldn't have been, tomorrow I'll have to work on the terrain generator. The hard thing is that there's no one who tells me I have to work on this. It's getting late in my time zone though, so I'm out of here.

Oh, and I did remember to water those cactuses, in case anyone wonders. And tomorrow I'll do the terrain generator, it isn't exactly a lot of work either, I have this tendency of stop working whenever something is almost finished, maybe I'm afraid of finishing stuff. Iduno, I'm a programmer, not a psychologist, let's keep it that way. See you tomorrow with hopefully a terrain generator, there, I said it, thus creating the critical pressure required to actually get it done! Uhm, about 24 hours from now maybe and I'll post a link to the applet.
 
Civ 1 is good enough for me. I don't think it needs much. When I want extensive rules and drastic changes from Civ1, I play Civ4. Just these two improvements are all I need:

Research, production, and food require pointless micro. Carry all overflow. Problem solved.

Better AI. But you're already set on that task. I'll just reiterate that AIs could dart around a selection of super-routines like Dack mentioned, but like he also mentioned, writing these would probably be something like scripting the Iliad.
 
OK thanks for the input so far. I've been struggling with the AI today, this project is going to take quite some time and I've never done a project this size, so please be patient, I excuse for the tardiness in advance (it's not like it will get finished in a mere couple of weeks, it's taken me about a month so far). I feel confident it should be possible to make an AI that's better than in the original though.

Anyway, addressing the input in order from above:

Determining how many years should pass should be easy, one interesting problem is if there's supposed to be only one year between 1BC and 1AD. 0AD would look weird, but maybe that's just me, I'll try to make everything easy to change.

I've been reading about terrain generation algorithms online, there's nothing that prevents the map from being bigger. As for the number of civilizations I wonder how one would tell them apart, as for the sprites of units I was thinking about having image files with transparent pixels, and then just set the transparent pixels to the background color of the civ and make it possible to specify background colors for various civs. Perhaps if the background colors are the same for two civs those couldn't exist in the game at the same time. That way I wouldn't have to know how many civs there would be, but changing the number would also require specifying colors for them. As for the units, tech, improvements, wonders, terrain improvements they would all be read from a file.

A map/scenario editor for placing units, terrain, editing cities and so forth is a given.

4. This is an interesting point, because you talk about performance. I was thinking that I should generate a new kind of save file that keeps track of the progress throughout a game. Say that you play 100 turns, save, then come back and decide that you want to go back 20 turns and choose different actions to test if the game would have worked out differently, you know the what could have been scenario. Anyway, normally if you didn't save 20 turns ago you would be out of luck, maybe you had a save that was 30 turns ago, then that would have to do. But what I'm going to implement is a save file that records the beginning of a game, including seeds to random number generators, and then keeps track of all the moves and basically just replays until that point, that way I hope to make it possible to come back to a game at any point of time. However, in order to discourage cheating the save file would keep track of the "canonical timeline", so if you go back and do something differently and then end up winning you would get an indication that you went back and won, and didn't win without going back to a previous point. The main idea with having all of the saves from one game stay in the same save file is to reduce the number of save files and make it easier to manage. The way this is related to performance is because the game would be playing itself up to the point that you chose to jump to from the nearest point in time when the whole state of the game was saved, if the AI was slow this would probably be when that problem would be the worst. I'll try to make the AI fast. Another thing one usually has to wait for though is for the AI units to move, if the AI has hundreds of units this could take some time. Perhaps there could be 3 different setting: 1. watch the AI move it's units one by one 2. watch units move many at a time if they're on the same screen 3. don't watch the AI move it's units

5. Or expressed another way have several governments chosen from different categories, so one could just add a government category and some governments, like free speech or mandated speech, in that category. One thing that comes to mind is if the choice of government in the various categories would be dependent on each other, like lets say there's two choices that go well together, like say democracy and free speech, but are not equally strong one by one. I think I could have the AI evaluate the value of each government choice in each city, to see how it affects things, but evaluating all combinations of governments in different categories might be to much work. I'm no AI guru, I can't do advanced stuff, but even if the AI was at a slight penalty for missing some particular combination of governments I guess that would still provide a good game experience.

6. I kinda have a blog already, but I havn't made any posts. I guess I'm kinda chicken thinking that I perhaps shouldn't say anything about what I'm doing, I may end up failing after all, or doing something stupid or unnecessary. But on the other hand maybe having the blog would increase my motivation, I just hope I wont say anything stupid.

Yes, I'm going to make it freeware, and then I'm going to make a Warlords clone. I have a really good game idea, a whole different kind of game than civ, I won't tell anyone about it yet, but it's this game that I want to make, that game is not going to be freeware. Civ is just something I'm doing to kinda practice a little at a big project, and also because the other game that I really wanna make involves too much art and is just really hard to develop. I have to make something easier before I make my dream game, but civ is turning out to be quite a lot of work too. My langauge is Java and I'm going to try to make it a dragable applet, that's an applet that runs in a web browser and can be dragged onto the desktop, that way there wouldn't be any "installing" the game. But if that doesn't work I think I'm just going to make it an executable jar, in any case it's going to be implemented in Java. As for the graphics I'm just going to make some simple placeholder images that can be replaced, if you wanted to make a new unit you would have to make a sprite for it anyway. The sprites will not necessarily have to be the same size. I don't know about open source though, I mean I've got some ugly code, so I don't know. In any case I've never been good at working in a group, I'm kinda a loner, not the kind to start projects on sourceforge.

Now I kinda don't know what to do next, let's see I have finished the parser generator, so parsing text files can be done, I've already previously implemented the code that displays sprites, including zooming in/out, it can zoom in/out in incremental small steps, I made it generic so that you could zoom an arbitrary amount, not just, say, half the size or double the size or anything like that, I don't know if that's going to be important later or maybe zooming is not something that people prefer at all, i don't know. Uhm, so, I guess now all that's left to do is... pretty much everything, let's see there's the city management/domestic AI, the defense AI (I think I'm going to try to do some zone of control thing that uses counterstrike units to take out units that comes close while staying out of reach of enemy units, think catapult in a forest or chariot on a plain and defensive units too, I've never done anything this advanced but I think I know how it should work), the attack AI (when attacking most units are probably exposed to attacks from counterstrike units, so I think a wall of defensive units moving forward would be the best way to go, possibly with some fast attackers behind them to take care of the defenders defensive units, again it's a first for me, but the AI in the original was so poor, at least all units should move together when attacking, not one by one), the central game logic (the glue that holds it all together), multiplayer, various screens (like city screen, diplomacy and so forth, this is probably going to take some time and look like crap, I am not an artist, as much as possible I'll try to make things customizable but I just don't know how I would enable a menu to be fully customizable), things I havn't thought about yet because I know there's probably some stuff I havn't thought about yet. Yes, there are some things I probably havn't thought about yet, and probably wouldn't have unless I actually tried to implement a game, yes I should have a blog. There this blog I use to follow, it was called "viridiangames" but he changed the name to "gamedevdad" a while ago, oh, wait (*face palm*), you know what? The reason I'm doing this whole thing was actually because I wanted to have a game development blog, but I didn't have anything to fill it with or make posts about, but then that position gradually changed into keeping things secret because they might not be good enough, somehow I managed to forget that I wanted to have a blog all the time, but the blog is actually all but finished, all I need to do is clear out the place holder posts that I used to customize wordpress and make a post.

I don't want to be mean but if all you have right now is display sprites / parsing text files, then you have a long time to go. Civ is a large game, it's not as simple as tic tac toe.
 
Make it so that if you attack and kill a enemy, you will not move to that unit's position. Reduce their attack by 1 or 2 and make it so that they will not die if they lose while attacking.
 
First, every citizen will be unhappy. Remove the free city tile being worked for free. Add one new city improvement:

Town Center:
+3 happiness, 6 upkeep, 30 hammers cost, city tile will be worked for free

The town center will be free in the capital.

This means that for the first while, your newly founded city will cost you. But if you place it in a good terrain, it will become profitable.

This change doesn't force you to build only a few cities, you can have dozens with good terrain.
 
I know Civ one is good enough, I have been playing Civ 1 so much I have no reason to knock it. But I'm not really implementing a game as much as I'm implementing a game engine that just reads rules from files. However I don't really know much about AI so in order to be able to make good AI I at least wanted to establish some kind of framework that the rules have to follow before I start. For instance should I assume that there are always food shields and trade, and that they work roughly the same way, or should I assume that a new types of production could be added, and I've resolved to keep the setup of having food, shields and trade fixed, assuming these things won't fundamentally change makes the project easier. There are other things that the AI shouldn't make assumptions about, like which city improvements or wonders there are, so the AI would have to iterate through them some how. And actually I think I know how the domestic AI should work. Carrying overflow sounds like a good idea, it would make the job of the AI easier too because the AI wouldn't have to micro manage either. But how about the granary for instance, if you are about to build it, but also about to grow a population, then perhaps you would be better of if you reduced the food output of the city until the granary is finished. That's some micro management too and I was concerned about whether I should make an AI that's smart enough to take advantage of that, but then basically the AI would have to try out many more combinations, maybe the granary should be changed too so that it only saved half of the food added after the granary was produced. In either case I've decided to make an AI that doesn't try to take advantage of such micro management, it reduces the number of combinations. I am going to try to make the AI see as far into the future as possible, a little like "chess with feedback" I imagine. I won't write blog posts about my ideas before I have at least tried them out, and that's going to take a lot of time. But the terrain generator should be easy.


Yeah I know Civ is a big project, but I'm working on it. Hey if I had spent 10% of the time I've been playing Civ on implementing it I would already have been done a long time ago ;) Oh, , I been playing Civ so much. Anyway, the upside to Civ taking a lot longer than I expected is that I learn new interesting stuff along the way, and I'm going to be blogging about it.

Make it so that if you attack and kill a enemy, you will not move to that unit's position. Reduce their attack by 1 or 2 and make it so that they will not die if they lose while attacking.
Not being able to die sounds suspicious, what I worry about is that it could make the game a lot harder for the AI. One of the reason the AI on Civ 2-5 suck so much is because the human player is able to pick a lot of easy fights and never lose units.

I'm gonna work on the terrain generator now. It's still a long way to go, but eventually I'll finish this. I've put everything else on a hold, I got nothing else I have to do. It's an addiction/obsession.
 
I know Civ one is good enough, I have been playing Civ 1 so much I have no reason to knock it. But I'm not really implementing a game as much as I'm implementing a game engine that just reads rules from files. However I don't really know much about AI so in order to be able to make good AI I at least wanted to establish some kind of framework that the rules have to follow before I start. For instance should I assume that there are always food shields and trade, and that they work roughly the same way, or should I assume that a new types of production could be added, and I've resolved to keep the setup of having food, shields and trade fixed, assuming these things won't fundamentally change makes the project easier. There are other things that the AI shouldn't make assumptions about, like which city improvements or wonders there are, so the AI would have to iterate through them some how. And actually I think I know how the domestic AI should work. Carrying overflow sounds like a good idea, it would make the job of the AI easier too because the AI wouldn't have to micro manage either. But how about the granary for instance, if you are about to build it, but also about to grow a population, then perhaps you would be better of if you reduced the food output of the city until the granary is finished. That's some micro management too and I was concerned about whether I should make an AI that's smart enough to take advantage of that, but then basically the AI would have to try out many more combinations, maybe the granary should be changed too so that it only saved half of the food added after the granary was produced. In either case I've decided to make an AI that doesn't try to take advantage of such micro management, it reduces the number of combinations. I am going to try to make the AI see as far into the future as possible, a little like "chess with feedback" I imagine. I won't write blog posts about my ideas before I have at least tried them out, and that's going to take a lot of time. But the terrain generator should be easy.


Yeah I know Civ is a big project, but I'm working on it. Hey if I had spent 10% of the time I've been playing Civ on implementing it I would already have been done a long time ago ;) Oh, , I been playing Civ so much. Anyway, the upside to Civ taking a lot longer than I expected is that I learn new interesting stuff along the way, and I'm going to be blogging about it.


Not being able to die sounds suspicious, what I worry about is that it could make the game a lot harder for the AI. One of the reason the AI on Civ 2-5 suck so much is because the human player is able to pick a lot of easy fights and never lose units.

I'm gonna work on the terrain generator now. It's still a long way to go, but eventually I'll finish this. I've put everything else on a hold, I got nothing else I have to do. It's an addiction/obsession.
It would make the AI quite simple, actually.

Have you thought about leaving the AI for customization? Like make it possible for people to make their own AI. Programming side, just have methods for city/unit/nation classes. Like:

City Class:
changeProdTo("Barracks");
workerPositions(array);

Unit Class:
moveTo(32,22);
setAction("Irrigate");

Nation Class:
research("Masonry");
setSliders(50,30,20);

Then the community can make their own AI.
 
But I'm not really implementing a game as much as I'm implementing a game engine that just reads rules from files.

As for a "game engine", it might be fun to write a program that plays CIV DOS. I'm sure one could mouse over DOSbox and emulate mouse clicks. There must be a way to stuff the keyboard with keystrokes. All of a sudden I'm glad I have too many real life commitments.


This should make for a fascinating read;
MIT news - Computer learns language by playing games
quote from above
The extraordinary thing about Barzilay and Branavan’s system is that it begins with virtually no prior knowledge about the task it’s intended to perform or the language in which the instructions are written. It has a list of actions it can take, like right-clicks or left-clicks, or moving the cursor; it has access to the information displayed on-screen; and it has some way of gauging its success, like whether the software has been installed or whether it wins the game. But it doesn’t know what actions correspond to what words in the instruction set, and it doesn’t know what the objects in the game world represent.

Learning toWin by Reading Manuals in a Monte-Carlo Framework
quote from above
This paper presents a novel approach for leveraging automatically extracted textual knowledge to improve the performance of control applications such as games. Our ultimate goal is to enrich a stochastic player with highlevel guidance expressed in text. Our model jointly learns to identify text that is relevant to a given game state in addition to learning game strategies guided by the selected text.

Edit: I had to add this from a post on the above topic
In 2011 Skynet becomes self aware and plays Civilization for 500 hours straight.. It then binges on Twinkies and Red Bull, lapsing into coma.. Thus mankind is saved.. from a post by Duong Nguyen on gamasutra.com
 
Sorry for no update today. I'm having some weird bug in my parser generator.
edit:
I'm still working on this. I thought it would take less time, but, well I have no explanation for why it's taken this long. Part of the reason may be that I'm lazy. I've spent a few hours today working on this, but tomorrow I hope I'll work all the day, that way I'll hopefully have the terrain generator finished by tomorrow evening.
new edit:
Well I worked with the project all day today, well I get up pretty late in the morning and I has to eat and such and I took a few breaks, but pretty much all day today, and I'm getting really close to having the terrain generator finished. It's going to feature it's own tiny DSL and it's going to be so awesome. Hopefully I'll finish it tomorrow, but it's really taken a long time, much longer than I thought.
 
Now I finally got the terrain generator kinda working, I havn't tested all of the features yet, but it's generating continents! Finally, that took a lot of time, speaking of time it's like 12:26AM here, I have to go to bed so tomorrow wont start too late, still a lot to do see. The reason it's taken so long is because I'm developing a DSL (there's an article on wikipedia about DSL, I just checked it out a while ago so the term is new to me), anyway I'm developing a DSL for the terrain generator. I'll write more about it later, speaking of later it's getting late. It's gonna be so awesome, although I'm realizing all of this is taking a lot longer than I originally thought, but I'm full of motivation, so I'm going for it. I'm seeing this project to the end!
 
Now there is a script that can be used to generate maps, I havn't uploaded the thing yet, but I was just wondering if that's too much to ask, I mean for people to write scripts. I guess I'll have to upload the map generator soon, but what I wonder is if it's getting too much work or if people, or if people in general prefer having as much of the nuts and bolts exposed as possible? So far the script contains the functions:
World(width,height,number of images to be displayed on top of each other,tile width(in pixels),tile height) - to generate the world
Rectangle("00ff00",32,32) - for a green square
Sprite - a function that turns an image, for instance a rectangle, or could be an image read from a file, into a sprite object. A sprite contains an offset, in case the image is not to be displayed at the corner of the tile, and a z index
Sprite(Rectangle("00ff00",32,32),0) - creates a sprite that's displayed first, so that other sprites could be painted over that sprite, useful if you want to have for instance road on top of grassland
Rule, RuleData, Pattern are used for deciding when various sprites should be displayed, sometimes you want to display some "coastal" sprites for instance because there's a place where land mets ocean, not because of the land or the ocean themselves, but because the both of them are there in a certain pattern.
Tag - a special function used to group various kinds of terrain together, useful when using other functions
Matrix, MatrixSet - used when specifying rules that change the way continents grow
Bucket - a special kind of continent that fills up the entire map with one kind of terrain. The map initially starts without any terrain at all, so the first step will probably be to use this function. Could perhaps be used to create "continents" of water on a map initially filled out with land
Continents(rules for how to grow them, number of continents, type of terrain of the continents, where to grow the continents)
SubContinents - used when growing continents inside continents, like continents of forest inside continents of grassland that initially got grown inside the ocean that was created with the Bucket function
Step(continents to grow, number of steps to grow them) - continents grow in steps, this function is used to make them grow a certain number of steps according to their respective rules
Target - for changing the target of a continent, not sure if this will be usefull
SetMatrixSet - for changing the rules by which the continents grow
Target and SetMatrixSet could be used for for instance making the ocean "eat up" some land after the land continents have grown some.
Terrain - the function that decides how various sorts of terrain are to be displayed, the easiest example is:
Terrain("grassland",Rule(RuleData(Sprite(Rectangle("00ff00",32,32),0))));
That would create the terrain type "grassland" and simply just display a green square inside it, but more advanced stuff could be made, like changing the sprite of a river depending on adjacent river squares, or making every other river square in a row of adjacent rivers have a bend on it, or displaying a Sprite of "coast" on an ocean square that's adjacent to land.

I guess that's all, I havn't used all of the functions yet, I've just implemented them. But a huge chunk of the work is done at least. So I'm just wondering if it's getting too complicated for people's tastes? By no means do I intend to force people to write a script every time they start a new game, but it could be the kind of thing one does if one wants to, say, if one wants to do something. iduno. I'll upload the terrain generator to my site soon, but first I'll polish it a little.
 
Back
Top Bottom