Map Database  •  FAQ  •  RSS  •  Login

TKE

<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 24 Feb 2009, 12:33

I'm curious about minimap cos I have to refresh it every frame and it slows KaM Remake noticably (almost by 20%). I draw it as series of colored 1px vertices. Of course this can be improved, but I was curious what approach did you chose and how effective it is. Maybe I got for texture later on, don't know.

I'm using textures from KaM Editor of mine - of course you saw them. There's no animation. As for KaM format - I don't think it's worth deciphering - it looks very complicated. I think I take series of screens from KaM and make own set of tile textures (how many are needed for animation - 8?).
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 24 Feb 2009, 14:31

Drawing 176*176 vertices seems like a bit much :)
I just put a textured quad there (the texture will be periodically updated), so far only with the "base layer" (terrain), the "exploration mask" or whatever it's called will be overlaid later so that unexplored parts will be black.

Ripping the animation from KaM that way is a bit of a hack, and it would take some time to get the right screenshots (accurately timing it by hand would be pretty much impossible), but why shouldn't it work, right? I just wish there was a better way..

The terrain is still bothering me somewhat, in KaM it looks like they used splines or something - it's all curved and nice.. While I could do that, it would make calculating the offsets for sprites a real bitch.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 24 Feb 2009, 14:45

It's all just the matter of lighting. KaM does not uses any splines or whatever. Just gradient lighting.

I found equation for lightning that is almost as good as KaM is (You can't get better without going to 8bit palette anyway) :)

Idea is you have ABCD tile:
A---B
| |
C---D

Firstly it's rendered without any lighting, colors are unchanged.
Next thing you calculate lighting value for vertices. For vert B it is B-(A+D)/2 this gives you B lighting. Same for all other vertices. Then you render lighing layer and darkening layer (of course you can combine all 3 into one in shaders, but I prefer simple 3-pass render). Light and dark are Color*coef (I could be wrong in terms here, but I hope you get the idea). Now you just need right coef for light and dark. Thats it.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 24 Feb 2009, 15:49

I get the idea, a bit anyway, in what way should the lighting value affect the coefficients? or does it affect the color?

How does this look so smooth?
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 24 Feb 2009, 16:08

I used coefs in 0..2 range (where 0 is dark and 2 is light). Coefs are multiplyed by color value if I'm not mistaken. So plain terrain has coef of 1 (color is preserved), and hills are 0..2 (light on one side, dark on another). Tile triangulation is important - it should be ABD and ADC. Values are interpolated - hence smooth looks. Download KaM Editor and see for yourself :wink:
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 24 Feb 2009, 16:21

Haha yes of course I have it, but it doesn't say how it works :)
Ok I will now try to implement this and see how it goes.. I'll let you know

Lol ok I did something wrong :P
Image
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 24 Feb 2009, 16:27

LOL, I referred to smoothing - KaM Editor does not uses any additional geometry nor splines nor anuthing. Simple quads and lighting, thats it. So you can compare it to KaM for yourself.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 24 Feb 2009, 16:43

Ok this looks alright
Image
I think it might need some clamping in the dark area's to prevent them from becoming completely black, how did you solve that? (or did it just work without needing a fix?)
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 24 Feb 2009, 16:59

ROFL at your first pic - that's a good one, keep it! :)

Second one looks okay, but maybe it should be a bit lighter overall, so far it looks a bit "dull", though it's hard to tell without referencing to KaM actually ...

Why does only few buildings have flags?
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 24 Feb 2009, 17:32

I forgot to interpolate the height for the midpoints of tile (which actually created the non-glitched squares) and I set the weight of the height to 1 instead 1/256 so it made everything either nearly white or nearly black :lol:

After some tweaking it became a lot lighter, looks nice now :)

I don't know about the flags, they're out of my control really..
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 25 Feb 2009, 00:33

Ok a new screenshot.

PNG for broadband users
Image
JPG for dial-up users
Image

Edit: you may temporarily download TKE from here: http://83.85.143.11/KAM_TKE.zip (6.5MB, 320KB/s max)
to test the terrain drawing etc. the game it NOT playable, you can NOT do anything besides taking a look. It's not finished so that's what you get.
Bug reports, suggestions, and translations (see DataFiles\lang), are of course always welcome.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 28 Feb 2009, 17:13

I did checked the beta - looks very good! :)
RX files (gui,houses,units) didn't loaded for some reason, they were as black or white rectangles, but that doesn't matter. Terrain looks well :)

P.S. Can you tell me about FogOfWar, how did you implemented it? In KaM Remake it's rather slow - every map node has 1byte value for it. Have to refresh it each 10th frame for each unit/house. I did a shortcut though - fog is rendered as if terrain is half-lit using same lighting idea I told you about before.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 28 Feb 2009, 17:33

The RX file problem is strange.. I haven't heard about that bug before..

But FoW, ok, rendering uses the same shortcut you describe. For the rest, I hope I remember it correctly.. When units move they change a count of the tiles that just entered their view and tiles that just left their view. When units die they decrement the count of all tiles that were in their line of sight, when they are created they increment them, same for buildings. The count is initialized to -1 for all tiles, when a unit sees a -1 tile its count is changed to 1. Tiles with count -1 are black, 0 are darkened, and for all other counts they're fully lit.
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 16 Mar 2009, 22:33

Ok so we have about 640KB of sourcecode now (not including data files that we generated of course)
Just in case anyone cares..

And no, that does not mean we have more "stuff" than Krom and Lewin (at least not necessarily) because it's in an other language. And even if it weren't, maybe we use more comments and longer variable names? So comparing by size makes no sense.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 17 Mar 2009, 05:48

Absolutely. Size comparision is very relative, depends even on number of whitespaces used in start/end structures :)
We can't compete in EXE sizes either, cos they depend on different libraries.
Besides - thats not the point at all :)

I believe both projects are well and alive, thats what matters. Besides - "competition" makes us stronger :)

P.S. I do write KaM Remake code size to compare it to itself, it reflects code complexity in a way..
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de

Return to “Other Creations”

Who is online

Users browsing this forum: No registered users and 8 guests