Page 3 of 47

PostPosted: 26 Dec 2008, 11:04
by merchant_992
Do you allready have some "village AI" now? Last update you said you were slowly moving toward it, and on a screenshot it is a bit hard to see.

Maybe you could show a short movie or a small Alpha/Beta version?

PostPosted: 26 Dec 2008, 13:21
by Krom
Village AI is there but limited to few houses you saw on screens. I will think about Alpha Demo ..

PostPosted: 05 Jan 2009, 15:47
by Krom
Now that Lewin joined KaM Remake project we are working together on it. That helps a lot, in past few weeks we've increased amount of code by 30% and keep on writing new lines :)

Perhaps Lewin can tell more of a story from his point of view, since I'm not as good at writing :wink:

PostPosted: 06 Jan 2009, 23:51
by Lewin
Ok, I will write you all a little story. :wink:

The Remake is FAR more advanced than you will think from looking at the screenshots. When I first ran the program I was shocked. The village is almost totally functional! About a quarter of the buildings work, and will produce wares, all using the correct animations. (e.g. the woodcutter chopping trees, the carpenter sawing logs) The serfs will transport the wares almost perfectly, with the correct animations of a serf walking holding the goods.

There are a few problems, such as that the path finding will not go around obstacles like buildings, water, rocks, etc. meaning units walk right through houses and other units.

Current implemented buildings:
Woodcutter, Sawmill, Stonemason, Farm, Mill, Bakery, Vineyard, Coal mine, Storehouse and School.
All of these buildings will function, although some with a few issues. (e.g. the stonemason does go looking for a stone hill, he always cuts his stone at 9,9)

Krom and I are mainly working on the user interface at the moment. (e.g. menus, house info pages, etc.) I have added the code to load the text from the LIB files, so at the moment almost all resources (fonts, images, statistics, text, sound, etc.) are being loaded from the original KaM files. (Unlike TKE, no offense Harold) This makes it easier for us as very little is hardcoded. (even animation indexes are loaded from units.dat and house.dat)


Krom is doing most of the actually programming and internal design, and then I do some minor bits like LIB loading. I also clean up after Krom, fixing minor bugs, as well as making the GUI look the same as KaM. (e.g. choosing the right font and positioning the controls in the same way)


Oh and some interesting news: A few days back Krom added a unit called LoadSFX. Guess what it does? Correct, it loads the sounds.dat file and can export them as WAV files! (sounds.dat contains small sound effects like the clash of weapons, sawing of logs, etc.) I thought people might be interested in this so over the next few days I will post all of the sound files on this forum in a ZIP. (as long as you don't mind Krom)
Then you'll be able to do things with them such as use them for a Windows theme or make sound tracks.

Almost every day Krom adds something new, and this project is drawing closer to a fully working village.
Lewin.

PostPosted: 07 Jan 2009, 08:42
by Krom
Thats right, there is no pathfinding at all. To be honest it looks very complicated, I didn't even tried making it. Units just walk shortest way, straight and diagonal. I hope together with Lewin we might make it work, something A* or alike.

Adding new buildings is easy since all structure is ready for it. E.g. IronSmithy acts same way as Bakery, just uses another input/output resources :) Although there's no ready solution for e.g. Swine/Stables, cos they have a lot of "behind-the-scene" scripting and various animations, but we will make it anyway :)

Using as much as possible from KaM resources allows us to keep Remake smaller and also suggests ways of doing things in certain ways - e.g. House animations are probably scripted same way as in KaM.

To be continued ...

EDIT: After all if KaM was programmed this way by professional programmer, not another, for good reason. As amateur I can only try to learn it :)

I have nothing against Lewin posting these sounds if anyone needs them. sounds.dat format is as simple as RX one - bunch of wave files one next to another with no encryption (unlike missions).

P.S. Good story Lewin! :)

PostPosted: 07 Jan 2009, 11:22
by harold
In TKE images are loaded from the original files, and sound is not loaded at all
I have no idea how the animations work, I didn't program them..

Anyway how do you guys do the stones around wheat fields and the wood around the vineyards? I can't figure them out..

btw we used to have plain A* but moved on to TA* which I can tell you is a bitch to program, but the result is much nicer

PostPosted: 07 Jan 2009, 12:17
by Krom
SoundFX is minor deal after gameplay is done. Sounds are stored as uncompressed WAV files inside sounds.dat, just read them to memory and access/use by e.g. OpenAL (I have some experience with it and probably KaM remake will use it). I was surprised KaM didn't used own sound format tbh.

I wish I could attach pics to this post .....

Normal cells are rendered as quads, 1x1 units (forget about heights for a moment). Now small Fences are rendered ontop of borders between quads, slightly overlapping them (by 0.1unit if I remember correct). In essence Fences are same quads with different texture and sized 1x0.2 units (of course we need to trim excess pixels from stones texture in UV coords).

I don't know how you make it with D3D, but in OGL I compile everything from simpliest pieces - quads. Even GUI :) So I can combine them in any way Remake needs - e.g. render fullscreen quad to make whole image lighter/darker (no need to bother with pallettes anymore) :)

PostPosted: 07 Jan 2009, 12:54
by Nick
sometimes i wish i could program also :(

PostPosted: 07 Jan 2009, 13:15
by harold
Ok well my problem with them is that they look odd when they're not completely straight - when they have to be rotated slightly due to height changes in the terrain. I don't know how KAM does this, but I can't replicate it..

PostPosted: 07 Jan 2009, 14:23
by Krom
Hmm.. I don't rotate them, I just skew 'em. You know, keeping all sides parallel (parallelogram).

Indeed KaM uses bitmap skewing, meaning no texel interpolation. Making that in Remake or TKE would be too complicated (rendering each column of pixels on own quad).

Still I think we can live with skewing for now ..

PostPosted: 07 Jan 2009, 16:02
by harold
Maybe the combination of skewing and nearest-neighbor sampling and some luck will get them right :)
If they aren't skewed too far, nearest-neighbor sampling should use the correct pixels.. but it will look screwy if they're skewed so far that it will use the next pixel.

PostPosted: 09 Jan 2009, 12:59
by Krom
I checked it - looks rather well with NearestNeighbour sampling.
Anyway you don't need to put fences along steep hills, cos you can't allow building there :wink:

PostPosted: 10 Jan 2009, 13:03
by Humbelum
It would be nice if you could see the building, where the serf is going to.

So if you see a serf with a stone and click with the magnifer on it you could see that he's going to a building site or road works.

That would make the magnifer more usefull because now you only see the condition

Good luck with your further programming

PostPosted: 12 Jan 2009, 17:58
by merchant_992
Could you maybe publish that LoadSFX? or is it part of the complete program? As i'm collecting every tool created for KaM i'm interested in it.

PostPosted: 12 Jan 2009, 22:42
by xzaz
Awesome!

Its still running and even faster then ever. Im checking the project once in a while say every week. Very cool, love to view a video about how everything is running. Thanks guys!