Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Everlands: the second Go

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Everlands: the second Go
imaxcs
Member #4,036
November 2003

Hi all(egroids)!

This thread is the follow-up of http://www.allegro.cc/forums/thread/587458.

I took your suggestions and tried to throw them into the game, so I would once again like to receive some input from you.

The download-area:
http://stud4.tuwien.ac.at/~e0625909/everlands/
You can either pick the *.rar or the *.zip, they contain the same files. For the Linux people: the source is available in the backup-folder, but I need to upload the Makefile yet.
For screenshots, go to the screenshots-folder.

Please tell me what you think now and if I have implemented your suggestions properly...

Thank you for your time,
Maximilian Csuk

tobing
Member #5,213
November 2004
avatar

This looks really good and promising.

Tried the techdemo immediately on my office PC: crash immediately, saying:
'The instruction at 0x00000000 referenced memory at 0x00000000. The memory could not be read.'

The everlands.exe from the link you give as 'download-area' does not load because it's cannot find the freetype6.dll...

GullRaDriel
Member #3,861
September 2003
avatar

{"name":"06.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/9\/199d7425951dcecbfb5aa92826a900fc.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/9\/199d7425951dcecbfb5aa92826a900fc"}06.png
{"name":"07.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/7\/3736cd4f11c07d0aaa821e2e5f8b7e26.png","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/7\/3736cd4f11c07d0aaa821e2e5f8b7e26"}07.png

Looks promising ! And source code is here, that's nice !

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

OICW
Member #4,069
November 2003
avatar

Looks nice, I'll download it and give it a try. One note, the grass looks flat, it will definately need some improvement later, but I suppose that this is only programmers graphics.

Edit: The question is - how do you do the outlining?

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

imaxcs
Member #4,036
November 2003

tobing: Thank you for checking it out! I am sorry it crashes for you, but I couldn't test it on a computer where the libraries aren't installed so I didn't exactly know that to include. I attached "freetype6.dll" in my post. You will need to put it in the same folder as the executable. Sorry! :)

Gull: Thank you! Feel free to browse the source. :)

OICW: The outlining was first done dynamically when the game loads. But I wanted to cut down the loading-times and the creating took too long. So I created a tool which creates the outlines and then places it in the folder "gfx/humans/*_outlines.png". Here is the code which does the dirty work:

1 BITMAP* bitmap = load_bitmap("human.png", NULL);
2 BITMAP* tmp = create_bitmap(bitmap->w, bitmap->h);
3 clear_to_color(tmp, makecol(255, 0, 255));
4 
5 int i, j;
6 for(i = 0;i < bitmap->w;i++)
7 for(j = 0;j < bitmap->h;j++)
8 {
9 if (getpixel(bitmap, i, j) == 0)
10 {
11 if ((i > 0 && getpixel(bitmap, i - 1, j) != 0) ||
12 (i < bitmap->w - 1 && getpixel(bitmap, i + 1 ,j) != 0) ||
13 (j > 0 && getpixel(bitmap, i ,j - 1) != 0) ||
14 (j < bitmap->h - 1 && getpixel(bitmap, i, j + 1) != 0))
15 { // pixel is next to a non-invisible pixel
16 putpixel(tmp, i, j, makecol(255, 255, 255));
17 }
18 }
19 }
20 
21 save_bitmap("outline.png", tmp, NULL);

It loads a file called "human.png" and creates a file called "outline.png". :)

edit: the download from the old thread is no longer recent and will not be updated anymore. Please refer to the one in this thread...

OICW
Member #4,069
November 2003
avatar

Hehe, pretty simple, at first I thought you use prerendered outlines. So I was right. Though i thought you make them with the sprite, and now it turns out you generate them after. Thanks a lot.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

tobing
Member #5,213
November 2004
avatar

Work nicely on my PC at home. Will try again in the office tomorrow...

imaxcs
Member #4,036
November 2003

Let's see if you people can finish one of the two "normal"-maps and tell your highscore! :) I have:

A New Beginning: 14 min 56 sec
The Deep Woods: 17 min 53 sec

Note that I am not sure if the finished game's score will solely be based on time.

LennyLen
Member #5,313
December 2004
avatar

I get the following error:

{"name":"590299","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/9\/291c3d3fe52aab70a2e87cda45ea50e2.png","w":590,"h":118,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/9\/291c3d3fe52aab70a2e87cda45ea50e2"}590299

I located and downloaded a copy of freetype6.dll, but I still get the same error.

tobing
Member #5,213
November 2004
avatar

Hi, now I tried on my office PC, with the freetype6.dll you supplied, thanks. I needed to copy the zlib1.dll from the techdemo version also, and with that: Same crash as with the techdemo version:
'The instruction at 0x00000000 referenced memory at 0x00000000. The memory could not be read.'

It might be an issue with OpenGL or so, I would try if you would pack the source code for me, so I could build here and maybe debug (I have MS VS.NET 2003 here with all extras).

GullRaDriel
Member #3,861
September 2003
avatar

Tobing: sources are here, that is a pity I am behind a fucking proxy, and I can only download a file at once. If you manage to download them all, I will be happy that you attach them here :-)

_

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

tobing
Member #5,213
November 2004
avatar

Thanks for the link, but I would need them packed to download, because I can only access that directory using http (from the office...).

Anyway, I just tried the OpenLayer 2.0 Demo program, which crashes exactly the same way, so it's most probably an issue with my OpenGL drivers. Think I'll check that now...

Edit: It's an Intel 82915G/GV/910GL Express chipset, and the driver date is 11/3/2005 - will check for an update.

Another edit: I'm behind a firewall here also, so I could only download one file after the other, something I don't have time to do now (being on work). Sorry, maybe someone else could help out?

Eradicor
Member #2,992
December 2002
avatar

Damn that looks nice. I hope i could do game by myself. Always wanted to do Civilization / Settlers type of game.

I also did "Tycoon type of engine" ... Gotta admit my tiles looked a lot better :D. But i suppose if this is still at "engine test" level not much care needed to have with tiles.

| Visit The site |
{Creating realms from dreams since 1995}

imaxcs
Member #4,036
November 2003

LennyLen: Sorry, I am at a loss there! Do you have this problem with all OpenLayer-programs or just with mine?

tobing and gull: I uploaded a zipped-package with the source and also a Makefile so you know which libraries I use (quite a few). Note that this is the Makefile I use under Linux. If you want to compile from source under Windows, use these link-flags:
-lopenlayer -lglyph-agl -lfreetype -lldpng -lpng -lz -lagl -lalleg -luser32 -lgdi32 -lglu32 -lopengl32 -lfmod

Link to source

I hope you can compile and run it! (Was anyone able to at least run the windows-binary? :( Distributing software is hard!)

Exitialis: Thank you for your kind words! :) Actually, I consider my game a bit farther than the "engine test"-state. But I just suck at graphics (not unusual here) ::) !

tobing
Member #5,213
November 2004
avatar

I have successfully run the windows-binary on my PC at home (the freetype6.dll was from my gtk+ installation).

GullRaDriel
Member #3,861
September 2003
avatar

imaxcs: Thanks, but I should have edit my last post because I finally was able to configure a website hoover which works nice trough my office's proxy ;-) (If anyone is in search for it, I am just sucking the whole flipcode site)

The binaries are launching with success (and no crash) on my laptop :-)

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

LennyLen
Member #5,313
December 2004
avatar

Quote:

LennyLen: Sorry, I am at a loss there! Do you have this problem with all OpenLayer-programs or just with mine?

I just saw the .dll you attached here and used that. Now it works.

The game looks good. The only things I immediately missed were the ability to move around the map by clicking on the minimap and tooltips for the mouse. I've noticed that when you select a building to be built, the mouse is changed to a transparent image of the building. You might want to have it not change until the mose is off the UI and on the game-screen, as it makes it hard to change the building you have selected and just doesn't look quite right.

imaxcs
Member #4,036
November 2003

Good to hear that it works with the *.dll! :)
And thanks for your good comments, LennyLen! Some things, I didn't even notice. But now I will implement them.

Anyway, did any of you manage to finish one of the maps?

tobing
Member #5,213
November 2004
avatar

Uh, yes, forgot to mention. I have finished the first tutorial. Well done!

LennyLen
Member #5,313
December 2004
avatar

The two times I've attemted to finish, everthing has been going fine, and then I accidentally destroy my castle by clicking on the X button. I keep thinking it's a "clear dialog" button. Perhaps a more descriptive button, like with a burning building on it, would help. Or at least a "are you sure you want to destroy that..." dialog.

[edit]I persisted, and managed to complete the "A New beginning" map without destroying my castle. I didn't record the time, but it wasn't great. I had the ratio of workers assigned to breadmaking, compared to those assigned to fishing, all wrong to begin with.

Oh, and I forgot to say earlier: Well done so far. I'm impressed with how well it all works. I'm sure it's taken a lot of effort to get it this far.

Something that I think could be improved however is the handling of workers. Having to hold W or C and right-clicking on a building is a bit cumbersome. I found that I was using W a lot more often than C, so perhaps if you made right-clicking automatically perform a W-right-click, and then use the C-right-click or Shift-/Ctrl-right-click for carrying.

I also found the small white-text that ran along the bottom to bet a bit too small for me to read. I had to move in closer to the monior to be able to read it.

There were a couple of other small things that I've now forgotten, but I'll note them down when I play the second map.

Again, well done!

[edit 2]I keep getting crashes at random places in the second map.

Trezker
Member #1,739
December 2001
avatar

I did the tutorials.

I also did the first mission but the game didn't count up my fish so I never won.

LennyLen
Member #5,313
December 2004
avatar

Quote:

I also did the first mission but the game didn't count up my fish so I never won.

I think this happened to me the first time I played the mission. But when it worked the second time through, I thought I'd been mistaken.

And regarding my earlier comment about the white font - that was in windowed mode. In full screen I can read it fine.

imaxcs
Member #4,036
November 2003

About the fish-thing: you are storing fish but the townsmen eat it right away at the beginning. It's like that: a human has a bar for the three kinds of food (meat, bread and fish, you can see them by selecting a human). If one human's bar is empty (let's say for fish) and there is a fish-resource stored globally (in the castle), the human will eat it right away. Hence, you can only start storing fish when all your humans are "fed up" with fish.

Thank you again for your comments, I need to skim through them first...

Quote:

I didn't record the time, but it wasn't great.

Did you see the highscore-table when you select a map? Your time should be listed there. Just select the right map! I admit that it's not a really straight-forward way to implement a highscore-table, but at least it works. :)

Quote:

I keep getting crashes at random places in the second map.

Any chance you can run it through a debugger? (like gdb?)

juvinious
Member #5,145
October 2004
avatar

Ok I grabbed the source and with lots of minor changes got it to work. Also had to download the demo to get the data files. The most annoying error I was getting during compilation was many of the files were missing #include <assert.h>. Next I had to fix src/path/path.cpp node_in_list because it didn't like it returning 0. I changed it to this and it compiled:

1list<CNode*>::iterator CPath::node_in_list(int c, int r, list<CNode*>& list_) const
2{
3 list<CNode*>::iterator it = list_.begin();
4 while(it != list_.end())
5 {
6 if ((*it)->get_c() == c && (*it)->get_r() == r)
7 return it;
8 *it++;
9 }
10 return list<CNode*>::iterator();
11}
12 
13// Also had to change two other lines around 177
14if (TileConversions::tile_valid(c, r, tiles) && TileConversions::get_tile(c, r, tiles)->walkable() &&
15 node_in_list(c, r, closed) == list<CNode*>::iterator() )
16 {
17 list<CNode*>::iterator node_in_openlist = node_in_list(c, r, open);
18 //g_modifier += int((TileConversions::get_tile(c, r, tiles)->get_h() - old_tile->get_h()) * CHeightmap::SLOPEHEIGHT);
19 if (node_in_openlist == list<CNode*>::iterator())

I also had to fix a case label in one of the files in the humans directory.
Lastly your makefile doesn't create the necessary directories (ie obj, obj/guichan ... etc) nor does it generate deps so I have to recompile everything from the beginning which is a pain.
After all that it compiled, then I ran it and I noticed two bad things. The first was that on the main screen, selecting options and credits it would slow down and practically make my whole system stop responding. The mouse movement was jittery and what not. Once I got to play game it corrected and didn't have any other problems into the game.
The second is that your pics in the main menu are all messed up, probably attributing to the problems above here's a pic:
{"name":"problemlx6.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/4\/747ac466e880686666e40297ec985b37.jpg","w":800,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/4\/747ac466e880686666e40297ec985b37"}problemlx6.jpg

Overall it's pretty neat, the user friendliness of it needs some work but it has an interesting system, especially the concept of work chains. All in all keep up the good work. :D

[edit]
Oh yeah forgot to mention, this is on linux. :)

__________________________________________
Paintown

imaxcs
Member #4,036
November 2003

Thanks for (successfully :)) trying to compile the code! I also use Linux but I don't have any of the problems you mentioned. I fixed the compile-errors you got, but I am not sure about the slowdowns and the messed-up colors. Could you tell me your gcc and Openlayer-version? :)

 1   2 


Go to: