View previous topic :: View next topic |
Author |
Message |
vgo DeleD PRO user
Joined: 19 Jan 2007 Posts: 28 Location: Finland
|
Posted: Sat Feb 10, 2007 4:58 pm Post subject: Space Commando (working title) |
|
|
I'm participating in the PGD 2007 Multiplexity game development competition. The idea in the competition is to make a game that combines 2 or more game genres, the entries have to be programmed in Pascal language (Delphi, FreePascal etc.).
My entry for the competition is titled Space Commando and it's a mixture of space sim and first person shooter. The players will be able to fly in space, dock with space stations and walk around inside them.
More information about the competition can be found here
BTW. Delgine seems to be one of the sponsors for the competition. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Sat Feb 10, 2007 5:19 pm Post subject: |
|
|
Yes, we are one of the sponsors indeed.
Goodluck with the compo! |
|
Back to top |
|
|
vgo DeleD PRO user
Joined: 19 Jan 2007 Posts: 28 Location: Finland
|
Posted: Sat Mar 03, 2007 4:38 pm Post subject: |
|
|
I've been working on my entry for some time and I'm making good progress on the game engine.
The problem I have is that I can't make any models besides some boxes and such, even if I could I don't have the time to do all that myself. I have a friend who's been helping me by making some models, but he is too busy with other stuff aswell.
If anyone could spare some models or make some for me I'd be grateful, naturally if we get things working you'd get your share of the prize too (in the case that we win, of course).
You can get the current build here. There's not much game in it yet, but hopefully that'll change soon enough. |
|
Back to top |
|
|
vgo DeleD PRO user
Joined: 19 Jan 2007 Posts: 28 Location: Finland
|
Posted: Tue Mar 06, 2007 2:02 pm Post subject: |
|
|
I've been writing import code for the new DXS format and I've ran into some stupid problems.
First, I need the vertices in counter-clockwise order, not in clockwise which seems to be used by DeleD. Second, I need my texture coordinates certain order: (top-left = 0, 1 -> bottom right = 1, 0) DeleD seems to store them so that 0,0 is top left and 1,1 is bottom right.
Vertices are easy to reverse to get the right winding, but what about the texture coordinates? How can I easily "flip" these? If I just reverse them, or try to assign them to the vertices in different order doesn't make any difference because the v coordinate is wrong. How to get the v coordinate to go from up-down to down-up while not skewing the coordinates?
Multiplying the v coordinate with -1 works for some, but if there's coordinates that are from 0 to 1 then I'd need to check for these and reverse them one by one. Is there another way to do this?
EDIT: I just noticed another problem, some of the faces are not visible ie. they face the opposite direction as they should! All these faces seem to be result of CSG operations, so it's not a bug in my code (I hope). How can I fix these? |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Fri Mar 09, 2007 8:13 pm Post subject: |
|
|
The vertices and uv-coordinates are compatible with a clockwise winding in an OpenGL-style coordinate system. For any other system, you'll indeed need to do some fiddling.
Quote: |
but if there's coordinates that are from 0 to 1 then I'd need to check for these and reverse them one by one |
It might be because it's Friday night and my brains are about to shut down, but I am kindda missing your point here. Why exactly can't you just set v to 1-v ?
About the missing faces / faces that are wound the wrong way: how do these faces show up in DeleD? There are indeed some known special/problem cases with CSG that might be causing this. If the polygons show up facing the wrong way in DeleD as well, at least you'll know it is not your code that is the problem.
Hope that helps. If not, let us know! |
|
Back to top |
|
|
vgo DeleD PRO user
Joined: 19 Jan 2007 Posts: 28 Location: Finland
|
Posted: Sat Mar 10, 2007 8:21 am Post subject: |
|
|
Paul-Jan wrote: |
The vertices and uv-coordinates are compatible with a clockwise winding in an OpenGL-style coordinate system. For any other system, you'll indeed need to do some fiddling. |
Actually the default winding is GL_CCW, not GL_CW.
I've reversed the vertex order for the faces and that fixed it. I could use GL_CW, but I have some other code for drawing primitives like cubes, spheres, toruses etc. which produce polygons in GL_CCW order and changing the front face mode for different objects would be a real pain in the ass. So it's easier to reverse the faces that I get from DeleD.
Quote: |
It might be because it's Friday night and my brains are about to shut down, but I am kindda missing your point here. Why exactly can't you just set v to 1-v ? |
Yes, I think that my brain was sort of mushed too, that's exactly what I eventually did and it works in every situation.
Quote: |
About the missing faces / faces that are wound the wrong way: how do these faces show up in DeleD? There are indeed some known special/problem cases with CSG that might be causing this. If the polygons show up facing the wrong way in DeleD as well, at least you'll know it is not your code that is the problem. |
I remade my test scene from scratch because I had too many objects in it to turn it into a portal based scene for my engine. I had a silly bug in my front face testing code and that caused the faces to disappear, but still it sometimes failed. I'd been messing with that scene for so long that I probably had reversed some faces and whatever (as I don't have a clue what I'm doing! ).
Anyway, now it works. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sat Mar 10, 2007 3:00 pm Post subject: |
|
|
Quote: |
Actually the default winding is GL_CCW, not GL_CW |
True, I tried to convey 2 seperate pieces of information in that sentence (a) the CW winding and (b) the OpenGL coordinate system (= righthanded) in that sentence, sorry if that was unclear.
Anyway, top job getting your loader to work! IMHO you definitely made the right choice by adapting your loading code, not your rendering code. The fiddling starts all over again whenever you choose to write a loader for yet another file format that upholds yet another standard. When writing loaders/importers I just stop thinking and use trial-and-error these days |
|
Back to top |
|
|
vgo DeleD PRO user
Joined: 19 Jan 2007 Posts: 28 Location: Finland
|
Posted: Sat Mar 10, 2007 8:44 pm Post subject: |
|
|
Paul-Jan wrote: |
Anyway, top job getting your loader to work! IMHO you definitely made the right choice by adapting your loading code, not your rendering code. The fiddling starts all over again whenever you choose to write a loader for yet another file format that upholds yet another standard. When writing loaders/importers I just stop thinking and use trial-and-error these days |
Trial-and-error is good.
I've written importers for 3DS and OBJ formats too, but I haven't bothered finishing them because it's easier to import the models to DeleD, save them to DXS and then import to my game's editor. |
|
Back to top |
|
|
|