Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 4 5 [6] 7

Author Topic: A 3D DF mod (in its infancy) and a request (now with SOURCE)  (Read 20633 times)

Ciehoo

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request
« Reply #75 on: January 30, 2009, 05:01:44 pm »

Updated the main post with SOURCE *gasp* ;)
Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #76 on: January 30, 2009, 05:09:23 pm »

Just noticed that you've tried to prove a point to me. :) Point taken, but when I still found modelling interesting, I churned out three-four models per day for my TA:Spring mod. So I know it's possible to make the models fast, but whether or not it's practical in terms of the Ogre engine and framerates remains to be seen. I'll just make an option switch for sprites then. ;D
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Ciehoo

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #77 on: January 30, 2009, 05:14:46 pm »

Just noticed that you've tried to prove a point to me. :) Point taken, but when I still found modelling interesting, I churned out three-four models per day for my TA:Spring mod. So I know it's possible to make the models fast, but whether or not it's practical in terms of the Ogre engine and framerates remains to be seen. I'll just make an option switch for sprites then. ;D

Fine by me :D As I said - I'm not really for it, but if someone else does the job, and it proves popular, then why not. Of course it would be best if everyone focused on the core project goals, but as it's open-source, then there's no way to control that.
Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #78 on: January 30, 2009, 05:51:01 pm »

I would point out that making it use sprites would not mean any additional work in regards to content (just look at the latest graphics set thread, that thing's gorgeous) again, but I think there's no point now. I'll go look at that code...
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #79 on: January 30, 2009, 06:22:52 pm »

I would point out that making it use sprites would not mean any additional work in regards to content (just look at the latest graphics set thread, that thing's gorgeous) again, but I think there's no point now. I'll go look at that code...

Just musing here, but I doubt DF makes it easy to grab the tile for creatures not in the current Z-slice.  I imagine you'll have to re-create the code used to read the charset/graphics BMPs, and possibly also reproduce the logic for applying status icons (bleeding, drowning, etc.) to creatures.

Bonus points if you use terrain tiles as the textures for terrain cubes.
« Last Edit: January 30, 2009, 06:25:28 pm by Footkerchief »
Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #80 on: January 30, 2009, 06:27:22 pm »

Um, hello? Providing the right memory hook can be found, it is possible to get ALL of the data for the creatures and items on the map. And DF's tile settings are in the raws, not to mention the memory as well.

And yes, that was my initial thought as well. Maybe not ONLY the tile, but at least a certain background overlaid with the tile.
« Last Edit: January 30, 2009, 06:28:53 pm by Sean Mirrsen »
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Ciehoo

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #81 on: January 30, 2009, 06:36:42 pm »

Just musing here, but I doubt DF makes it easy to grab the tile for creatures not in the current Z-slice. 

As all the creatures (including dead ones) are stored in one big list, it's possible to get the data very easily. In fact, that's the way the dwarves in the "demo" are displayed.

I imagine you'll have to re-create the code used to read the charset/graphics BMPs, and possibly also reproduce the logic for applying status icons (bleeding, drowning, etc.) to creatures.

The loading code is pretty simple to implement. Matching graphics to creatures is a bit harder, as it requires some poking in assembly but still, very doable. The status icons - didn't look at that part of the code yet, but it's probably saved in some flags somewhere.

But all in all, still not on my priority list, so don't hold your breath for any code from me.
Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #82 on: January 30, 2009, 06:56:18 pm »

Oh, come on. Surely the creator of Dwarf Companion can help out in this (or at least the program itself). I know it just reads the memory from without, but it does it in real time... so status icons won't be any serious problem for a serious coder. The graphics are mostly defined in one big file, so a simple parser akin to the one used in Modbase can work, and the only required information on the unit would be its type and state/profession.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #83 on: January 30, 2009, 07:16:13 pm »

Oh, come on. Surely the creator of Dwarf Companion can help out in this (or at least the program itself). I know it just reads the memory from without, but it does it in real time... so status icons won't be any serious problem for a serious coder.

I wasn't saying it would be a hang-up by any means.  I'm just thinking out loud.  There's also the multiple-creatures-in-same-tile situation to consider. 
Logged

monolar

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #84 on: February 01, 2009, 05:45:03 am »

Currently reading the code and it reads quite ok apart from this insane assembler part ;) - thanks for all this!!

I'm not sure if my skills are good enough to expand it but i'll definitely try to fiddle around with it - once i install all the VS stuff on my windows box - i only code on my mac currently.

And i think the code is documented good enough to get a grip quickly. My only gripe is GEGUI which i never liked for a purely subjective irrational reason - could just be the default gui appearance, which is completely fugly.

EDIT:

I wonder if maybe it would even be worthwhile to use this to create basically the same kind of interface as the standard DF with some addons:

  - Zoomable map (to some degree)
  - make everything customizable through graphical tilesets, basically expanding the current capabilities.
  - better interface?

Anyway, how to get commands to the interface, assuming we would want to hide the DF window and recreate parts of the interface?
« Last Edit: February 01, 2009, 08:56:28 am by monolar »
Logged

Ciehoo

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #85 on: February 01, 2009, 10:36:16 am »

Currently reading the code and it reads quite ok apart from this insane assembler part ;) - thanks for all this!!
Hey - the AsmCall object is the best documented piece of code in the whole project ;)

I wonder if maybe it would even be worthwhile to use this to create basically the same kind of interface as the standard DF with some addons:

  - Zoomable map (to some degree)
  - make everything customizable through graphical tilesets, basically expanding the current capabilities.
  - better interface?
As it is open source now, anything can be done, what can be thought. (how it will run is another thing altogether).

As far as I'm concerned, I thought about bringing the interface up to par with similar commercial games, with objects themselves being more interactive. I think it can be done pretty reasonably if more people work on it.


Anyway, how to get commands to the interface, assuming we would want to hide the DF window and recreate parts of the interface?

Either by replicating the underlying menu code in C++ (even using AsmCall to jump out into appropriate menu handlers), or poke changes directly into DF data, and let the game loop make sense of it.
Logged

monolar

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #86 on: February 01, 2009, 01:17:09 pm »

Okay, after some reading i understand the injection hook for the most part - thanks to codeproject.com and of course msdn.

What i don't understand is this:

DWORD WinMainLoc = 0x00518C70;

in "Dwarf Launcher.cpp". How did you derive this address? I assume it is DF version specific!?
Logged

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #87 on: February 01, 2009, 02:41:48 pm »

I just want to say that this looks very impressive.  Keep up the good work dude.
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Ciehoo

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #88 on: February 01, 2009, 03:30:28 pm »

Okay, after some reading i understand the injection hook for the most part - thanks to codeproject.com and of course msdn.

What i don't understand is this:

DWORD WinMainLoc = 0x00518C70;

in "Dwarf Launcher.cpp". How did you derive this address? I assume it is DF version specific!?

Yes it is - it might be possible to do it in a more universal way, but I needed a way to clobber the main game loop, to provide custom message handling, and skip rendering. This was the most obvious solution. Anyway, as far as I recall, it's not that hard to find the location, and update it for other versions.

To describe the launcher code, as it's not documented:

Code: [Select]
#ifdef __ASM_DEB
uchar int3; // debug the assembly code obviously
#endif
uchar pusha; // save all registers
uchar push1; // command opcode for pushing "OgreDwarf.dll" pointer on the stack
DWORD OgreDwarfPtr; // previously mentioned "OgreDwarf.dll" pointer
ushort call1; // command opcode for calling a library function
DWORD LoadLibraryPtr; // LoadLibraryA adress (result of the call is in EAX register -> handle to the library
uchar push2; // command opcode for pushing "CustWinMain" pointer on the stack
DWORD CustWinMainPtr; // previously mentioned "CustWinMain" pointer
uchar push_eax; // push OgreDwarf.dll library handle on the stack (the arguments are pushed in reverse order)
ushort call2; // command opcode for calling a library function
DWORD GetProcAddressPtr;// GetProcAddress pointer (result in eax) our exported library func
ushort call_eax; // command opcode for calling the address stored in EAX
uchar popa; // restore all registers to their previous state
uchar retn; // return to previous function (the one that called "WinMain"
uchar OgreDwarfStr[12]; // "OgreDwarf.dll"
uchar CustWinMainStr[12];// "CustWinMain"
« Last Edit: February 01, 2009, 03:37:37 pm by Ciehoo »
Logged

Drunken

  • Bay Watcher
    • View Profile
Re: A 3D DF mod (in its infancy) and a request (now with SOURCE)
« Reply #89 on: February 09, 2009, 06:31:03 am »

I may be wrong about this, and even if I am right it is probably irrellevant but:
The fact that this is released under a global public licence means that if we make this project and it works well and everyone likes it and then toady gets to the presentation arc...
It would be nice if toady could use this. He has always been against doing such things and it is highly unlikely that he would want to use it but still it seems good to leave it open as an option.
Again I might be wrong about this, it is possible that Ciehoo doesn't want to hand this project over to Toady free of charge or doesn't want it used as an official part of DF but I doubt this.
What I am proposing is a new type of licence that I dont know has ever been tried before: GPL exception. So put a disclaimer in that if Toady specifically as an entity wants to use any or all of this code in a proprietary project he does not have to open the source of that project, or make it free. I don't know much about copyright law but I think that the current licence doesnt actually mean he has to open source to use it. But it still forces him to keep the game free. Mind you that might be a good thing.
Thoughts anyone? I am probably just talking out of my arse.
Logged
A stopped clock is right for exactly two infinitessimal moments every day.
A working clock on the other hand is almost never ever exactly right.
Pages: 1 ... 4 5 [6] 7