Warhammer Dark Omen Forum

Modifications => Tools => Topic started by: crash on October 03, 2013, 06:49:29 PM



Title: Map Viewer questions
Post by: crash on October 03, 2013, 06:49:29 PM
I have a few questions for the author of the Map Viewer(Rob?).  I have been messing around, trying to get a C# engine going, and I am having problems rendering.  Using your tools and looking at your project, I still cant get the base to look right.

In b101, for the tree groups are you using the mesh part's texture name to toggle the color keying?  Can you describe how you render the base, _gtregp1 in particular.  The black color key is giving me trouble.  How do you handle the transparency?

https://dl.dropboxusercontent.com/u/21362347/tregp.png

 Are you using the shd file in the map viewer to draw the shadows on the base? Or the heights and macroblock from the prj terrain section?

The attr block is listed as being packed 2 to a byte.  Can you post a pic of your attr block and terrblock (as bmp?) so I can compare?  My attr doesn't look quite right.

Here is a screenie from my engine.

https://dl.dropboxusercontent.com/u/21362347/current%20100313.png

Oh, and thanks to everyone keeping this game alive.


Title: Re: Map Viewer questions
Post by: olly on October 03, 2013, 07:39:24 PM
Hi and welcome!

I think that is Mikademus' Dark Omen Map Viewer which doesn't know to make the black edges of the 3d trees become invisible, like the original game engine does.

Ghabry is the only live modder that continues to help me with new Height Map Generator that we do make the ATTR block identical to the TERR block, as far as I can remember.  

Please keep posting your progress as sounds a cool project.

:)



Title: Re: Map Viewer questions
Post by: crash on October 03, 2013, 08:46:01 PM
Here is an older pic that better illustrates my problem.

https://dl.dropboxusercontent.com/u/21362347/first%20try%20terrfx.png

Clipping out black leaves the top see-through, and I have no idea what is causing that line on the edge.  I am currently changing the technique according to the texture name, because I don't want to see through the black on the base.


PS How can I get a pic to appear on this thread?


Title: Re: Map Viewer questions
Post by: olly on October 03, 2013, 08:49:08 PM
i use imagshack.us and then copy and paste the embedded image link

Also try Rob's BTB Editor that displays an image of the TERR block

http://en.dark-omen.org/downloads/1.-modding-tools/1.-map-editor/index.html (http://en.dark-omen.org/downloads/1.-modding-tools/1.-map-editor/index.html)



Title: Re: Map Viewer questions
Post by: Ghabry on October 04, 2013, 01:51:56 AM
Sorry, can't help you with this.
I usually don't do 3d programming. You actually have better results then me. I never could even get the base display correctly ;)

Do you plan sharing the source later? Would be good a good starting point in case someone wants to write a 3d editor.

You can also upload the images as an attachment.


Title: Re: Map Viewer questions
Post by: Rob on October 12, 2013, 03:55:28 PM
Hi Crash,

The author of the map viewer was Mika, who hasn't been around for quite a while.

Colour key transparency is a really old way of doing this effect and I doubt that modern cards would support it well.  You'd probably be best to create a new texture with an alpha channel and manually set this to transparent if the color from the original texture matched the colour key.

You could then render with alpha test turned on (don't know how you're doing it now).

If you're trying to make a 3d editor or remake, I have some old C# libraries that you may be able to use to find out how some of the undocumented formats work: https://docs.google.com/file/d/0B8yyPPq-QlxtQndmZ29OckpacG8/edit?usp=sharing

Good luck!


Title: Re: Map Viewer questions
Post by: olly on October 12, 2013, 11:19:06 PM
Not sure it will be of help but here is NewBoids Test Engine, created by original Dark Omen programmer Andy Buchan, that i found years ago to share to help kick start our combined mod projects. It can load Dark Omen level .PRJ files ->

http://www.mediafire.com/download/i2d7d47f869cgpe/NewBoids.zip (http://www.mediafire.com/download/i2d7d47f869cgpe/NewBoids.zip)

and his C++ Source Code

http://www.mediafire.com/download/snlo7j6e6b75rdf/NewBoidsSource.zip (http://www.mediafire.com/download/snlo7j6e6b75rdf/NewBoidsSource.zip)

I think it was of some help in understading .PRJ but only up to the INST block and not the harder TERR height map stuff.

:)


Title: Re: Map Viewer questions
Post by: crash on October 21, 2013, 08:13:05 PM
Thanks for the other projects.  They will be a lot of help.  I was surprised to see that they might have used boids in DO, that would have been new stuff at the time. 

For the base mesh I set the effect for the meshpart based on the texture name, and it works ok.  The problem I was having was easily solved once I added the textures to the project again.  XNA4 uses premultiplied alpha by default, and I had a texture set to turn that off,  which caused the weird looking render.  Tore my hair out for a week before I figured that out.  Going forward, the easiest fix for that and the trees would be to keep clipping the black (0,0,0) and change the color of the black I want to keep to a different shade like (8,8,8).

[attachment=1]


Title: Re: Map Viewer questions
Post by: crash on October 21, 2013, 08:21:30 PM
Here are some projects for loading the dark omen files.  Be warned, I am not a qualified software engineer, so if they cause a Conflagration of Doom on your house, don't blame me.

   To run these projects, you will need Visual Studio 2010.  The Express edition is fine.

ParsePrj   This MIGHT need the terrain and attribute blocks fixed.  Export images of them to see.  Modeled after the files in the do projects from your tools section.  However, this does not match the .cs files from the earlier post.  So, check it out, and post if you find out.

ParseBtb

ParseShd   can export images of shd files

unitcreator   load arm files.  when saving, the file size is the same, but the file    is a little different because of junk in the strings.  I did not fix because i planned on making my army file format a little different.

These projects don't do much other than save and load the dark omen files, but they should be a good start.  olly, can you post this zip in your tools section?

https://dl.dropboxusercontent.com/u/21362347/open%20d%20o%20files.zip


Here is a 2d project I am using to help me figure out Astar pathfinding.  It looks like I will need to use multiple grid sizes for the regiments.  In addition to VS2010, for this you need to have XNA GameStudio 4.0 refresh.  If I left the files in the bin\Release folder, you can just get the XNA 4 redist to run(assuming you have DotNet 4.0).

https://dl.dropboxusercontent.com/u/21362347/unitmovetest2d101913.zip

Here is a sample of my current progress.  Yes, the camera is jerky, and there are garbage collection stalls, but I am in the middle of another disaster, so they will have to wait.  You need the XNA 4 redist to run.

https://dl.dropboxusercontent.com/u/21362347/xotest101513.zip


Title: Re: Map Viewer questions
Post by: olly on October 21, 2013, 10:01:23 PM
Awesome progress, well done. Have downloaded and can't wait to test. We will upload to tools section later this week and please keep the posts coming!

:)



Title: Re: Map Viewer questions
Post by: Ghabry on October 22, 2013, 09:45:37 PM
In case you havnt already noticed it:
You can take the mapping for the ARM files (e.g. which values means which banner, sprite or item) from the database.xml that I ship with Wh32Edit.

Will check out the other files later, nice work, currently on vacation ;)


Title: Re: Map Viewer questions
Post by: crash on October 24, 2013, 06:46:18 PM
Oops!  I was in a hurry and made a serious mistake.  The path to get the arm files was still hardcoded, so the last listing will crash and make you mad. >:(  Delete that, and use this instead.

https://dl.dropboxusercontent.com/u/21362347/XOmen102413.zip

Like the other project, you will need dotnet 4.0 and Xna 4.0 refresh redistributable to run.

Sorry.

[attachment=1]


Title: Re: Map Viewer questions
Post by: crash on October 24, 2013, 06:51:42 PM
Thanks Ghabry for permission to use your database.  Is there a way you could post the file for the army stats.  The link on the wiki didn't work.


Title: Re: Map Viewer questions
Post by: olly on October 25, 2013, 02:20:19 PM
I'm hoping that Ghabry will still have the Regiment data list from http://wiki.dark-omen.org/do/DO/ARM (http://wiki.dark-omen.org/do/DO/ARM) as wasn't in my Archives, although I think Mikademus created it so I can always email if required.

My modding pc doesn't have a compatible graphics card to test your creation on (probably not Dx10/11 for high def as its an Nvidia 7800GTX that allows Dark omen to run in 3d on Win7) so will try my new gaming pc (Nvidia Titan 6GB and Hex Core Intel 4.2GHZ) which should work.

(http://img547.imageshack.us/img547/6606/7w2l.jpg) (http://imageshack.us/photo/my-images/547/7w2l.jpg/)



Title: Re: Map Viewer questions
Post by: olly on October 25, 2013, 03:09:06 PM
Very cool indeed! Works fine on my new Win8 pc

(http://img4.imageshack.us/img4/9613/if6f.jpg) (http://imageshack.us/photo/my-images/4/if6f.jpg/)

Many thanks, a battle editor/remake keeps me awake at night, thinking of such a great possible future.

:)


Title: Re: Map Viewer questions
Post by: crash on October 31, 2013, 08:33:57 PM
I made a change to how the PRJParser outputs an image for the attribute data.  Here it is.

https://dl.dropboxusercontent.com/u/21362347/ParsePRJ103113.zip

And here is the source for my game project.  Something in it might be useful for someone to make an editor.  I don't have Rob's files in yet, so this project really shouldn't be shared, because I currently convert the DarkOmen assets to a different format.   Not currently using the PRJ terrain and attribute data,  I couldn't get them to work right, so I rolled up the .map you can see in the b101 folder.  I ended up having to do raycasts on the terrain to generate heightmap data. The shaders don't have any lights, but it should be easy to add Phong, etc.  There is a lot wrong with it, and a LOT to do, but it's better than nothing I guess.  No docs, and no help.  Sorry.  To use, you need Visual Studio 2010(Express is fine and free) and the full XNA framework 4.0.  

https://dl.dropboxusercontent.com/u/21362347/XOmenoldmovement103113.zip


Title: Re: Map Viewer questions
Post by: crash on November 04, 2013, 08:09:51 PM
Bugfix for units with only one member.  Delete the version from Halloween.

https://dl.dropboxusercontent.com/u/21362347/XOmenbillvsoldmv110413.zip


Title: Re: Map Viewer questions
Post by: Ghabry on November 07, 2013, 12:13:46 AM
I wonder why olly takes so long to respond, usually he is faster :)

Just showing some presence:
Will check out this tool next weekend, weeks lack freetime ^^


Title: Re: Map Viewer questions
Post by: olly on November 07, 2013, 03:41:00 PM
im  in hospital but now have limited internet access to say excited about  crash's amazing progress, big thanks. back home soon hopefully! keeps me going in bad times. :)


Title: Re: Map Viewer questions
Post by: crash on November 07, 2013, 07:15:07 PM
Sorry to hear that.  Here is the last update for a while.  Now, you can toggle the drawing of the debug info with the space key.  It only draws one chunk of the regions at a time, which you can increment with the B key.  Get it while it's hot.  Will take it down soon.

https://dl.dropboxusercontent.com/u/21362347/XOmenoldmv110713.zip


Title: Re: Map Viewer questions
Post by: olly on November 07, 2013, 08:02:59 PM
cheers bro, hoping to be home to download early next week, if u could leave it available please, as only on a linux based touch tv whilst in hospital, until then. post some inspiring pics to keep me  going. :)



Title: Re: Map Viewer questions
Post by: crash on November 07, 2013, 08:31:26 PM
Some pics of the debug info.  Best I can do right now.

[attachment=1]
[attachment=2]
[attachment=3]


Title: Re: Map Viewer questions
Post by: olly on November 07, 2013, 08:40:22 PM
nice :)


Title: Re: Map Viewer questions
Post by: olly on November 12, 2013, 11:54:23 PM
Could you upload again please. Thanks

:)


Title: Re: Map Viewer questions
Post by: olly on November 16, 2013, 01:56:14 PM
I've been having great fun and learning with all your Parser programs and Unit Creator software, many thanks! Will upload asap

[attachment=1][attachment=2][attachment=3][attachment=4]