OK, got framerate up to 37fps at the moment. Might slow down alot once the game loop is running. Might be worth putting 3D math in a separate thread??, then boost the graphics thread to a higher priority level. Might get a few extra frames.
Currently tinkering with SetStyle() property of form object.
I'm buffering everything that is bufferable: textures, rectangles, matrices and ImageAttrib objects. Happily this code I have for DD doesn't seem to slow things down at all!!
OK, got framerate up to 37fps at the moment. Might slow down alot once the game loop is running. Might be worth putting 3D math in a separate thread??, then boost the graphics thread to a higher priority level. Might get a few extra frames.
Hmm....not sure not sure...an extra thread gives overhead as long as you don't have a multithreaded CPU, and we need to have the input commands and the math synced, if not, it will be really jerky. No need to render 100FPS if the input and the movement is only updated 10FPS. If you see what I mean...
Originally Posted by wossname
Currently tinkering with SetStyle() property of form object.
I'm buffering everything that is bufferable: textures, rectangles, matrices and ImageAttrib objects. Happily this code I have for DD doesn't seem to slow things down at all!!
Not yet, its nowhere near ready to let you loose on it, you'll only break it.
Woo000o0t, I had been testing using 32bppRGB format images and was getting crap times. Changed it to 24bppRGB and it went from 37fps to 57fps!!!
Then I changed it to 32bppPARGB (premultiplied Alpha + RGB) and i'm now getting 130fps for a single wall section!! 130 walls sections per second isn't bad at this stage and I'm trying to work out how to turn off Antialiasing for stretched images.
We'll be able to have colored ambient light too since this matrix thing carries no speed penalty. Neat eh?
Also found a 'fix' to the seams on the wall panels, I altered the triangles to overlap very slightly so there is now no gap. However, the warping of the patterns still occurs but there is a way around it. You know the diagonal seam? If that seam passes through a vertical line on the pattern then you can't tell that its warped... lets draw textures where only verticals are allowed to cross the diagonal seam.
Its a bit of a bodge but its nothing out of the ordinary for game coders eh?
Earlier on today I spent half an our shouting at my machine because it kept drawing all my images really dark, then I suddenly realised that my DD code was working already! I'm too good.
130FPS...now we are talking......lets just wait two sec so I can get it down to 10FPS again..
BTW just as a hint. Rendering in real time is defined as 10FPS at 640*480pixels. So we are way in front of our schedual. But I hope I can manke my part of this too though.. Still havn't even had the time to look at the read in an out stuff. Will do that right now..
About the textures. I think that will be "ok"..not more or not less. Brick walls and doors and what else contains only horizontal and vertical lines after all. We just have to watch out for funky wall paper with spots/dots/and burbery on them..
About the textures. I think that will be "ok"..not more or not less. Brick walls and doors and what else contains only horizontal and vertical lines after all. We just have to watch out for funky wall paper with spots/dots/and burbery on them..
- ØØ -
Just to clarify, horizontals will be a problem but only if they cross the seam.
BTW, where do you usualy put the brackets in C#? After the line, or on a blank new line? I usualy add them to the same line. Guess it is an old VB habbit. LIke this:
Code:
using System;
class DoomSharp{
public static void Main(){
Console.WriteLine("DoomSharp Will make you young...");
Console.WriteLine("DoomSharp Will make you pretty...");
Console.WriteLine("DoomSharp Will make you sexy...");
Console.WriteLine("DoomSharp Will make you smart...");
Console.WriteLine("DoomSharp Will make you happy.........");
}
}
OK...for now I will just define a WallPart as this. This is a quad, I guess you are the man that have to translate this into two triangles? Or should it be done in this class too? And add the "fix" for the stipled line between the two triangles?
[Removed because of frustration]
Last edited by NoteMe; Sep 15th, 2005 at 06:31 AM.
That quad is fine, for now. I have been rendering from an array of triangles but I can adapt your wallparts to that no problem. Can you find a way to also pass me a value saying how far away this wallpart is from the camera? Maybe a float value as a fraction of the total depth (if our far plane is 1000 metres away and the wall is 243 metres away give me 0.243). I suppose this could be an average of the distances to each corner of the wall. Then I can use my DD
I always put the opening brace { on the next line, mainly because thats how intelisense does it. I prefer it this way but I don't really mind.
I haven't used any namespaces yet as I am trying to keep everything loose so I can change it later.
This is my first screeny with perspective, a floor and a wall, the vanishing point is roughly centered on the screen. Vertical lines are no problem as you see here, both these textures have verticals running through them and show very little distortion.
OK...for now I will just define a WallPart as this. This is a quad, I guess you are the man that have to translate this into two triangles? Or should it be done in this class too? And add the "fix" for the stipled line between the two triangles?
The fix is done, but you can sometimes still see some tiny atrifacts ()
How are we going to use that wallpart if all its members are private?
Woohooo..that looks awsome.......great job.....I was actualy sitting thinking about two problems now.
1. How to tell you and me and the WallPart class what texture should be assosiated with it. I guess the name of the texture and the "id" tag for it will be read from the Map file. So I guess that is my problem, but then I have to have a way to assosiate it with the WallParts, and then store the textures somewhere, and then tell you what texture goes to what wallpart. Have you thought about this at all? How are you storing the textures now? Any structure at all, or just loading and drawing at the moment?
2. What units to use. I guess this is entirly up to me. But you can at least help me out by saying aproximatly how many meters one of those wall parts are. BTW what you drew now, is that ONE wall part and ONE floor part, or two of each?
The fix is done, but you can sometimes still see some tiny atrifacts ()
How are we going to use that wallpart if all its members are private?
You will only use the render function.....I will sort the wall parts, occlude those that are not going to be rendered, then you will spew through the rest of the array, or list, or tree, and render them as fast as you can in the order they are listed..
Maybe 2 metres for each wallpart? makes it easier to visualise.
I've been using this structure to represent 'wallparts' (only I use 2 of them for each wallpart)...
PHP Code:
public struct Triangle
{
public Point A;
public Point B;
public Point C;
public int TextureNum; //the index in the textures[] array
public bool Upper; //is this triangle the upper half of the texture?
public Triangle(Point a, Point b, Point c, int tex, bool upper)
{
A = a;
B = b;
C = c;
TextureNum = tex;
Upper = upper;
}
}
My engine has a LoadTextures(string[] paths) method that loads all the images specified in the string array. So once your 3d engine has booted it can call LoadTextures on my class and the indexes will automatically be right, then you can just send an integer along with each wallpart saying which texture to use.
My engine has a LoadTextures(string[] paths) method that loads all the images specified in the string array. So once your 3d engine has booted it can call LoadTextures on my class and the indexes will automatically be right, then you can just send an integer along with each wallpart saying which texture to use.
OK, sounds good, will read the texture names from the file, and then call that function. Will it return something like an ID or something? Or should my app manage that it self?
There are sevaral path function in System.IO namespace but I don't know if they accomodate Linux or not.
app.path == Application.StartupPath()
Yeah we should merge teh engines together but probably much later on nearer to completion time.
I'm struggling with framerates again, If we can get away with using small-medium rooms then we can keep the framerates as high as possible, drawing loads of textured triangles(2 per wallpart) is tough.
OK, sounds good, will read the texture names from the file, and then call that function. Will it return something like an ID or something? Or should my app manage that it self?
- ØØ -
The renderer takes the indexes from the string's position in the array, the path in [0] will be texture 0 and so on.
Not very far....I am still on the planning stage on many areas....havn't started to atualy deside if BSP or PaintersAlgo is the best way to go yeat.....but I will, I will..
And yeah...I think small room and cooridors is the way to go. Nothing big and fancy.
Will test the app path stuff for linux and come back to you on that one..
It is, but I mouse-resized it (after drawing) to make it a bit smaller on the forum (all my timings are at 800x600 buffer and form client area). Now the bottle-neck seems to be copying the bufer to the screen. Can't think of any way to make this faster without changing thread priorities.
I have finished the first part of the level loader. But there is still a lot more to do , like calculating the coordinates of the wall parts...hmmm....interesting..
My desk just went 7" toward the roof, that is how exiting this is.....I still need to get my act togheter with this math stuff though..grrr...this is hard..
I think we should try to find some original Doom textures for this. I have googled for it but they all seem to be wrapped up in Doom format *.WAD files (Where's All the Data?).
I don't fancy ripping lots of textures out of screenshots either. I'll post in chitchat about this.
I think we should try to find some original Doom textures for this. I have googled for it but they all seem to be wrapped up in Doom format *.WAD files (Where's All the Data?).
I don't fancy ripping lots of textures out of screenshots either. I'll post in chitchat about this.
Post on an other forum:
Use Wintex 4.4 to extract DooM/DooM II sprites.
I guess that is a windows tool....care to check it out?
WinTex and XWE are free, and the graphics and lump management featurea of DeePSea are free. (The map editing features of DeePSea are shareware, with a limit on the size of the map you can edit. The full registered version obviously has no limit on map size. Overall, DeePSea is very versatile, and well worth the registration fee.)
All three programs will allow you to extract DooM graphics and save them in .bmp format. AFAIK, WinTex and DeePSea will only save the images as 256 color images. XWE gives you the option to save as 8 bit or 24 bit images. It also allows you to view (if not manipulate) Quake graphic files. Give it a try, as it's quite similar to Wally.