Progress

Showcase your completed projects or get feedback about your work-in-progress

Progress

Postby RDSouth » Mon Jan 23, 2012 7:43 am

AGen is awesome! And I have it to thank for enticing me to Lua.

I used to mod Civ, but Civ V was so bad I decided to strike out and make my own game from scratch,
much more ambitous than C-evo or FreeCiv --graphically on a par with Civ III but more like what I think
Civ V should have been in terms of gameplay. I was using an engine called PTK, but it was hard to get it
to work with anything past XP, it couldn't get transparency right, and frankly all that stuff you're "supposed to do" in
C++ was getting me down.

AGen is EXACTLY what I needed.

Now I can focus on writing my game instead of dealing with all those former issues, and it's coming along nicely but still not presentable.
At this point this is just a thank you note, but I intend to thank you eventually with a demonstration of what AGen can do.

Thank You
RDSouth
 
Posts: 5
Joined: Mon Jan 23, 2012 7:26 am

Re: Progress

Postby Ivan » Mon Jan 23, 2012 2:27 pm

Hi, welcome to the forums.
Sounds pretty cool! Love the Civ series and I've always wanted to make a strategy game myself so I'd be quite curious to see where your project goes.
Definitely keep us posted.
Ivan
Site Admin
 
Posts: 414
Joined: Thu Dec 27, 2007 9:21 pm

Re: Progress

Postby flankattack » Wed Jan 25, 2012 5:33 am

I too love the entire Civ series. However, I completely disagree that Civ V was a bad game. It just wasn't as good as Civ IV. Anyway, I shall try and avoid going on a rant about it.

Good luck with your game. It sounds like a very awesome, but very large, project.
Download Digital Sudoku today!
Coming Soon: Shift, the all new puzzler from Savage Games
flankattack
 
Posts: 50
Joined: Tue Jul 07, 2009 9:22 am
Location: New Zealand

Re: Progress

Postby RDSouth » Thu Jan 26, 2012 10:17 am

It IS a large project, but I am about to retire so there will be plenty of time.

So far I have created the map generator, the foundations of the user interface and the early stages of an
economic system. Its maybe a hundred functions in 20 files plus a bunch of sprites.

(I attach the whole thing zipped. Just under your max limit, so I guess as it gets larger I'll have to share the files another way.)

What I'm doing is just taking a copy of the whole AGen folder I downloaded, minus tutorials and documentation, and putting my own files in Scripts and Sprites. It works fine, runs when I hit the exe.

However, I have run into a problem with unresponsive keys.

Currently the map is just a bunch of squares. I use the arrow keys to move the whole thing around, and planned to use WASD to move units.
I found that the function for doing this wasn't working, and scoured my code for the problem. Finally, I took a piece of code I use to turn off the Fog of War in response to a certain key combination (a cheat) and stuck it into the function with the WASD stuff. It worked outside but not inside.

I reversed the keys for the map movement, so that used WASD and unit movement would use the arrow keys. The map movement stopped working.
In fact earlier, I had been forced to change

keyboard.on_release = function ( keyboard, key )
if key == KEY_ENTER then

(which advances time by a month for unit movement, while the spacebar advances it by a year for economic activity)

to

keyboard.on_press = function ( keyboard, key )
if key == KEY_ENTER then

because it simply did not respond to the former.

Question is, what's wrong with the keys?
Attachments
Copy.zip
(231.97 KiB) Downloaded 72 times
RDSouth
 
Posts: 5
Joined: Mon Jan 23, 2012 7:26 am

Re: Progress

Postby Ivan » Thu Jan 26, 2012 4:01 pm

Hey, I tested the game replacing the arrow keys with WASD and it seems to work fine.
What kind of keyboard are you using, perhaps it could be a hardware/DirectInput issue?

I noticed that you are shifting all the sprites whenever the user moves the map. This is causing significant slowdown since you are moving 120*60 sprites each frame.
Did you know that you can move the entire layer:
Code: Select all
Terrain.x = Terrain.x + 8


Also, there is a visual terminal included with the engine which can be useful for debugging, finding bottlenecks and memleaks. It can be started like so:
Code: Select all
display:create ( "Supergame", 1280, 640, 32, true )

require("terminal")
terminal.create()
terminal.terminal.depth = -1000

On my machine the game runs at 20FPS until I click on the map.
Ivan
Site Admin
 
Posts: 414
Joined: Thu Dec 27, 2007 9:21 pm

Re: Progress

Postby RDSouth » Thu Jan 26, 2012 7:10 pm

I have a Hewlett Packard with 4 Athlon II 640s and running 64 bit Windows 7. The problem did not exist on my old Vista machine or my old XP machine, only this one. I tried it with different keyboard also. I can work around it, since only numbers 1-0 and letters A-Z are affected. Map movement can be shift plus direction keys and unit movement can be just the arrow keys. But it speaks to portability. If I'm affected, how many others are?

I'm not sure how to use the Assert. Does it output to a log? A console? Can I set it up to make something happen if true, so I can see if it happens? Maybe i should read up on asserts.

As for moving the level instead of the sprites, I saw that in the book and I tried that and also a camera earlier. All the methods worked, but I decided to go this way, at least for now. I forgot why I didn't want to use a level, but moving the sprites makes translating between screen information and array information less complex and I guess I thought itemizing sprites might give me more control, which might be useful in the future. Really its just adding the same small number over and over to a few thousand variables in an array, not really a bunch of graphics crunching except for what's on the screen.

With Civ like games the bottleneck is in putting a complexity of useful information visually on each tile, which can only hold so much graphically.
The art is in designing how to do that. I'm planning to have just one Terrain sprite, one Habitation sprite and one Unit sprite per tile. Stacks of units will be represented by the program analyzing the stack and deciding what kind of higher echelon unit that makes up. So, if you have a tile with two infantry divisions and one armor division, the program presents that as an Infantry Corps. Similarly, tiles will have villages, towns, cities and metroplexes in them, as well as a complex mix of economic activity. There is no need to represent what kind of town that is ( a mining town or farming town), just that its a town. Your strategic awareness includes what you remember about it, and if you want to know more you look it up. In Civ IV, do you think people look at the city represententation to know what buildings are there? For one thing they don't all show, even if you have a microscope, becuase the presentation changes as more buildings are added, bumping some. You know the cities in your empire, so you don't have to look.
RDSouth
 
Posts: 5
Joined: Mon Jan 23, 2012 7:26 am

Re: Progress

Postby Ivan » Fri Jan 27, 2012 5:26 am

RDSouth wrote:I have a Hewlett Packard with 4 Athlon II 640s and running 64 bit Windows 7. The problem did not exist on my old Vista machine or my old XP machine, only this one. I tried it with different keyboard also. I can work around it, since only numbers 1-0 and letters A-Z are affected. Map movement can be shift plus direction keys and unit movement can be just the arrow keys. But it speaks to portability. If I'm affected, how many others are?

Can you please confirm if those keys are reported at all when using the "keyboard.on_press" and "keyboard.on_release" callbacks.

Another thing you can try is editing the "settings.ini" file (from the AGen directory):
Code: Select all
[input]
plugin=Plugins\AgenDI8.dll

Replacing the above line with:
Code: Select all
[input]
plugin=Plugins\AgenDI9.dll

Lastly, you want to make sure that "use_windows_keyboard" is set to "no":
Code: Select all
use_windows_keyboard=no


RDSouth wrote:I'm not sure how to use the Assert. Does it output to a log? A console? Can I set it up to make something happen if true, so I can see if it happens? Maybe i should read up on asserts.

"assert" is just used for debugging purposes.
It opens a dialog window showing an error message if the supplied condition is "false" or "nil".

RDSouth wrote:Really its just adding the same small number over and over to a few thousand variables in an array, not really a bunch of graphics crunching except for what's on the screen.

Changing the position of sprites does a few things on the engine-side as well.
In short, a lot of individually moving sprites do tend to cause slowdown.
On the other hand, static sprites are rendered and culled pretty fast.

RDSouth wrote:With Civ like games the bottleneck is in putting a complexity of useful information visually on each tile, which can only hold so much graphically.
The art is in designing how to do that. I'm planning to have just one Terrain sprite, one Habitation sprite and one Unit sprite per tile.
Stacks of units will be represented by the program analyzing the stack and deciding what kind of higher echelon unit that makes up.
So, if you have a tile with two infantry divisions and one armor division, the program presents that as an Infantry Corps.
Similarly, tiles will have villages, towns, cities and metroplexes in them, as well as a complex mix of economic activity.
There is no need to represent what kind of town that is ( a mining town or farming town), just that its a town.
Your strategic awareness includes what you remember about it, and if you want to know more you look it up.
In Civ IV, do you think people look at the city represententation to know what buildings are there?
For one thing they don't all show, even if you have a microscope, becuase the presentation changes as more buildings are added, bumping some.
You know the cities in your empire, so you don't have to look.

Certain city improvements in Civ4 are useful when shown on the map screen like, for example city walls. :)
But yeah, I know what you mean. I don't think this should be an issue if you just redraw the sprites that are on-screen.
Ivan
Site Admin
 
Posts: 414
Joined: Thu Dec 27, 2007 9:21 pm

Re: Progress

Postby Phil » Sat Jan 28, 2012 8:50 pm

My advice is to try
use_windows_keyboard=yes

in the input section of settings.ini. It should be more compatible than DirectInput.
Phil
 
Posts: 200
Joined: Fri Dec 28, 2007 12:47 am

Re: Progress

Postby Phil » Sat Jan 28, 2012 8:52 pm

... and Civ V is far superior to Civ 4.
Phil
 
Posts: 200
Joined: Fri Dec 28, 2007 12:47 am

Re: Progress

Postby Ivan » Sun Jan 29, 2012 6:17 am

Phil wrote:My advice is to try
use_windows_keyboard=yes

Have you tested "use_windows_keyboard", because I don't think it was fixed since:
http://www.2dengine.com/forum/viewtopic.php?f=2&t=301

In fact, keyboard input doesn't work at all in the latest GUI module when "use_windows_keyboard" is set to "yes"
Ivan
Site Admin
 
Posts: 414
Joined: Thu Dec 27, 2007 9:21 pm


Return to Showcase

Who is online

Users browsing this forum: No registered users and 1 guest

cron