Mirage Source

Free ORPG making software.
It is currently Wed Apr 24, 2024 4:27 am

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sat Jan 12, 2008 10:26 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Image

Converted Winds Whisper's engine to DirectX8 for a new project I'm working on.

It can handle Alpha Channels!

Here's the .png files which are used as textures.

Image
Image

If you save those and load them in photoshop, you'll see that those bits which look transparent really are :D

Only took me a couple of hours for the conversion which I think is pretty good.

I replaced my character with the pole thing, so all I need to do now is make the engine recognise what tiles are saved where and render them appropriately :P

EDIT:

Here's a special effect :D
Image

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 12:41 am 
Offline
Pro

Joined: Mon May 29, 2006 5:01 pm
Posts: 420
Location: Canada, BC
Google Talk: anthony.fleck@gmail.com
Tutorial!

xD. Looks very nice Robin. *is jealous*


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 6:08 am 
Offline
Knowledgeable
User avatar

Joined: Sat Jun 03, 2006 8:48 pm
Posts: 172
Location: Naiyo Region
Google Talk: matt.nwachukwu@gmail.com
Congratz.

But, does it really take that long to convert just a few blts here and there to DX8?

_________________
Image
みんな、見ていてくれ!


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 6:57 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Took Smchronos a long time to make his engine dx8.


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 2:19 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Matt wrote:
Congratz.

But, does it really take that long to convert just a few blts here and there to DX8?


Lol. You really don't understand DirectX do you?

DirectX7 allows you to use DirectDraw, which allows you to just copy any piece of a bmp file to a backbuffer and create an image.

In DirectX8 you no longer have 2D support. Everything needs to be created in a 3D environment and all the sprites and tiles need to be saved in a texture format.

All the ingame graphics need to be created using polygons.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 4:19 pm 
Offline
Pro
User avatar

Joined: Mon May 29, 2006 3:26 pm
Posts: 493
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com
3D is really more complicated than 2D, but the problem that I faced when trying to convert to DX8 was not the 3D, because I had some experience with it, but was the DX8 it self... I wasn't able to know which is the best and easiest way to initialize everything so I didn't even started...

_________________
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:
www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:
I love you and your computer.Marry me.


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 4:34 pm 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
Well pretty much the big difference between using DX7 and DX8 is in DX8, you use textures, not surfaces. You can use surfaces, but it is ugly and slow and ruins the whole purpose.

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
PostPosted: Sun Jan 13, 2008 7:15 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Luckily all my graphics were in the correct texture format ^^

Btw, made it so the engine can recognise the Mirage tile system now.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Mon Jan 14, 2008 1:31 pm 
Offline
Knowledgeable
User avatar

Joined: Sat Jun 03, 2006 8:48 pm
Posts: 172
Location: Naiyo Region
Google Talk: matt.nwachukwu@gmail.com
Robin wrote:
Matt wrote:
Congratz.

But, does it really take that long to convert just a few blts here and there to DX8?


Lol. You really don't understand DirectX do you?

DirectX7 allows you to use DirectDraw, which allows you to just copy any piece of a bmp file to a backbuffer and create an image.

In DirectX8 you no longer have 2D support. Everything needs to be created in a 3D environment and all the sprites and tiles need to be saved in a texture format.

All the ingame graphics need to be created using polygons.


Ahh. I get it now.

We gotta start off somewhere. Lol. Learning DirectX in all would be nice. xD

_________________
Image
みんな、見ていてくれ!


Top
 Profile  
 
PostPosted: Mon Jan 14, 2008 4:40 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Yeah, I know what you mean.

It was such a big transition between BitBlt and DirectDraw, and an even bigger one between DirectDraw and DirectX8.

My advice to anyone is to use DirectX8. It might look harder, but it's actually a lot easier to manage than DirectDraw.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Mon Jan 14, 2008 8:25 pm 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Smchronos removed HP bars from the Engine because he said DX8 had issues drawing 2D rectangles or something.


Top
 Profile  
 
PostPosted: Mon Jan 14, 2008 10:00 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
He fails at Dx8 then.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Tue Jan 15, 2008 12:49 am 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
Issues drawing rectangles? Everything is triangle, and a rectangle is just made with two triangles. If he is talking about untextured rectangles, they are just that - untextured. Set the texture to Nothing. Thats all it takes. If you can't get that right but you can convert the rendering to DX8, well thats just some good signs of copy-and-paste action. :wink:

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
PostPosted: Sat Jan 19, 2008 12:26 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Image

Image of it using Mirage's tile system.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Sat Jan 19, 2008 12:32 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Image


Top
 Profile  
 
PostPosted: Sat Jan 19, 2008 12:43 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
God that's ugly.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Sat Jan 19, 2008 1:02 am 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
It's just text.
It's because it's skinnable.


Top
 Profile  
 
PostPosted: Fri Jan 25, 2008 12:16 pm 
Offline
Newbie

Joined: Mon Nov 19, 2007 12:58 am
Posts: 3
I myself have spent the last week working with DirectX 8 and am almost finished converting my engine.

Since you (Robin and Spodi) have done so already, I have a few questions if you don't mind:

- Why you you have D3DRS_LIGHTING turned on in that screenshot? I was under the impression that is was useless in a simulated 2D world.
- Did you code in any kind of night or lighting system? I am having trouble figuring out the best way to do it. Multi-texturing sounds good, but it forces the lights to line up with and be the size of a tile, does it not? However, when I alphablend light in random places, I have trouble figuring out how to darken the rest of the tiles (darkening the vertex colors doesn't seem to work).
- How do you directly edit the alpha channel of individual pixels in Photoshop? I have looked and searched and googled and I can't figure it out.

Thanks in advance.


Top
 Profile  
 
PostPosted: Fri Jan 25, 2008 2:10 pm 
Offline
Pro
User avatar

Joined: Mon May 29, 2006 3:26 pm
Posts: 493
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com
I just finished converting too. I had the same problem xD Night it self is easy, but draw a big box and set the rgba color of all the vertices to 0,0,0,alpha value, and make it like... 170, that's my night. About the lights, I'm not sure...

_________________
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:
www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:
I love you and your computer.Marry me.


Top
 Profile  
 
PostPosted: Fri Jan 25, 2008 2:50 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Jonny9797 wrote:
I myself have spent the last week working with DirectX 8 and am almost finished converting my engine.

Since you (Robin and Spodi) have done so already, I have a few questions if you don't mind:

- Why you you have D3DRS_LIGHTING turned on in that screenshot? I was under the impression that is was useless in a simulated 2D world.
- Did you code in any kind of night or lighting system? I am having trouble figuring out the best way to do it. Multi-texturing sounds good, but it forces the lights to line up with and be the size of a tile, does it not? However, when I alphablend light in random places, I have trouble figuring out how to darken the rest of the tiles (darkening the vertex colors doesn't seem to work).
- How do you directly edit the alpha channel of individual pixels in Photoshop? I have looked and searched and googled and I can't figure it out.

Thanks in advance.


I have no experience in DX8 at all.

I literally spent 3 hours converting the other day because I wanted to work with those tiles I have, which are full of alpha channels.

I was basically just ripping out parts of the old DX8 engine Kenko and I worked on for NarutoRealm. Luckily I'm a fast learner, and I know how to do things with it now.

Haven't done a lighting system yet, although I probably will do, as I'm currently in talks with Rory to implement a Harvest Moon style farming system.

Here's a screenshot of the opacity tool:
http://img222.imageshack.us/img222/1231/lolololololololbk7.png

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Fri Jan 25, 2008 10:17 pm 
Offline
Newbie

Joined: Mon Nov 19, 2007 12:58 am
Posts: 3
Robin wrote:
I have no experience in DX8 at all.

I literally spent 3 hours converting the other day because I wanted to work with those tiles I have, which are full of alpha channels.

I was basically just ripping out parts of the old DX8 engine Kenko and I worked on for NarutoRealm. Luckily I'm a fast learner, and I know how to do things with it now.

Haven't done a lighting system yet, although I probably will do, as I'm currently in talks with Rory to implement a Harvest Moon style farming system.


Ahh, I see. Thanks anyway.

Robin wrote:


Thank you. I can't believe I didn't see that.

Dragoons Master wrote:
I just finished converting too. I had the same problem xD Night it self is easy, but draw a big box and set the rgba color of all the vertices to 0,0,0,alpha value, and make it like... 170, that's my night. About the lights, I'm not sure...

Yeah, I have done similar things to produce a nice night effect, but I still can't get lighting to work the way I would like it to. Oh well, back to working on it! :)


Top
 Profile  
 
PostPosted: Fri Jan 25, 2008 10:58 pm 
Offline
Pro
User avatar

Joined: Mon May 29, 2006 3:26 pm
Posts: 493
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com
If you get any advance, let me know plx ^^

_________________
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:
www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:
I love you and your computer.Marry me.


Top
 Profile  
 
PostPosted: Sat Jan 26, 2008 12:06 am 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
Jonny9797 wrote:
I myself have spent the last week working with DirectX 8 and am almost finished converting my engine.

Since you (Robin and Spodi) have done so already, I have a few questions if you don't mind:

- Why you you have D3DRS_LIGHTING turned on in that screenshot? I was under the impression that is was useless in a simulated 2D world.
- Did you code in any kind of night or lighting system? I am having trouble figuring out the best way to do it. Multi-texturing sounds good, but it forces the lights to line up with and be the size of a tile, does it not? However, when I alphablend light in random places, I have trouble figuring out how to darken the rest of the tiles (darkening the vertex colors doesn't seem to work).
- How do you directly edit the alpha channel of individual pixels in Photoshop? I have looked and searched and googled and I can't figure it out.

Thanks in advance.


Its been a while, but D3DRS_LIGHTING isn't useless in a 2D world but rather useless on lit verticies. Typically this is how 2D games are done because self-lighting your verticies is incredibly easy. You often have a grid of tiles and don't break that structure very much in a 2D game, while in 3D you, many times, can't even figure out where the verticies are without toggling the display and many verticies need to be handled on a hardware level because you have so many models and a much more varying world using stretched and transformed textures.

To do day and night, just change the lighting. If you're using lit verticies, which you most likely are/will be, you just have to decrease the RGB values of every light. If you are storing your lights as a long which you probably should be to have to prevent converting to a long every render (which happens more often then converting from a long), then you can easily break it apart using a little series of bitshifts and bit-wise operations. I can elaborate how to do this if anyone wants. I love bit twiddling. :D

To edit the individual pixels in Photoshop... good question, and I wish I knew. I wish other programs made the setting of the alpha value as easy as Flash makes it. :( Only thing I have ever figured out how to do is flood fill the alpha channel in Paint.Net using a 3rd party plug-in, and that just allowed me to get rid of the background. What kind of sick, twisted world is this where people don't care so much about alpha channels? Its madness! Maadddnneesss!!!!

(Robin, you will probably like this:)

By the way, if anyone is interested in doing some dynamic lighting in DX8 + VB6 without removing the TLVertex, check this out:
Optimized vbGORE implementation: http://www.vbgore.com/forums/viewtopic.php?t=6258
Unoptimized stand-alone theory implementation: http://www.vbgore.com/forums/viewtopic.php?t=4709

The first is optimized for vbGORE using minimalist updating, a bit based on vbGORE's engine (size of the screen view, for instance), but can easily be changed to your own. The latter is a stand-alone project that doesn't use much optimizing, but is much easier to read. I recommend checking out at least how I optimized it for vbGORE, and probably even just copying a lot of that code. Keep in mind my vbGORE implementation does not make use of the rest of the map lights which makes it a bit like a software version of hardware lights, but you guys can probably change it without too much effort to work with both. I was just sick of trying to deal with vbGORE's map lights to get it to work. :P

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
PostPosted: Sat Jan 26, 2008 1:47 am 
Offline
Newbie

Joined: Mon Nov 19, 2007 12:58 am
Posts: 3
Spodi wrote:
you just have to decrease the RGB values of every light

Yeah, that it how I was doing it.

Spodi wrote:
By the way, if anyone is interested in doing some dynamic lighting in DX8 + VB6 without removing the TLVertex, check this out:
Optimized vbGORE implementation: http://www.vbgore.com/forums/viewtopic.php?t=6258
Unoptimized stand-alone theory implementation: http://www.vbgore.com/forums/viewtopic.php?t=4709

The first is optimized for vbGORE using minimalist updating, a bit based on vbGORE's engine (size of the screen view, for instance), but can easily be changed to your own. The latter is a stand-alone project that doesn't use much optimizing, but is much easier to read. I recommend checking out at least how I optimized it for vbGORE, and probably even just copying a lot of that code. Keep in mind my vbGORE implementation does not make use of the rest of the map lights which makes it a bit like a software version of hardware lights, but you guys can probably change it without too much effort to work with both. I was just sick of trying to deal with vbGORE's map lights to get it to work. :P

Wow! That is exactly what I was looking for. Thanks for posting the source. I can't wait to go through it.


Top
 Profile  
 
PostPosted: Sun Jan 27, 2008 7:00 am 
Offline
Regular
User avatar

Joined: Tue May 30, 2006 5:52 am
Posts: 43
Looking good so far! I apologize for some of my sloppy coding. Make sure you don't release the source -- for obvious reasons. Other than that, keep up the awesome work, Robin! :wink:

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group