Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / What can I do better than DirectX?

Author
Message
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th Jun 2004 16:05
This isnt a DarkBasic question Id like to make clear. Ive already asked in a more relevant forum but recieved no answer so I thought maybe someone here could help.

Silly question it might seem, but pretty soon Im going to start developing a 2d game engine and, to be honest Ive never really understood what goes into making the engine so unique and different from rivals. It seems DX handles all the drawing based routines and adding my own software rendering techniques would only add overhead and slow things down, which Im trying to avoid. Now apart from the obvious (particle systems, collision etc) what can I put into it? I want to maintain speed, is there anything I can code myself, (particularly in relation to graphics) to create better effects etc? Or is it all down to DX?

Cheers

flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 18th Jun 2004 16:56 Edited at: 18th Jun 2004 16:58
The thing that makes engines different is how they handle objects, and what features of DirectX they use and how they use them. If you're going to make a 2d engine, i seriously recommend you read "Windows Game Programming For Dummies" by Andre LaMothe. Its a must read on how to do this kind of thing.

But for rendering and such, let DirectX do it, cos its gonna be faster than your code, because you will have to go through DirectX to draw things anyway.

M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th Jun 2004 17:27
Thanks Flibble

flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 18th Jun 2004 17:32
its okay, i was in your position not too long ago. While your at it, you should try making 256 colour paletted mode games. You can do some really cool effects in it.

M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th Jun 2004 19:02
Really? ive not looked into the colour format side of things in great detail yet, Im focusing on getting the most out of hardware accelerated 2d. This means Ive been looking at alphablending etc, using a 32bit format with and alpha channel (most likely png). Im using DX8 to make a tile based 2d engine as a project to keep me busy... So whats the deal with 256p games? What can you do with 256 colours that you cant with a few million?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 18th Jun 2004 19:32
Quote: " i seriously recommend you read "Windows Game Programming For Dummies" by Andre LaMothe"


Another excellent read which covers everything 2d and directX is this bookhref] http://www.bigwebmaster.com/110.html[/href]

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 18th Jun 2004 19:39
I guess a good way to decide on engine functionality is to figure out what you need by planning out a few basic game ideas. Decide what you'd need to pull them off, then make them engine features. I mean, if I visualise a platform shooter, I think I'll need pixel level collision of sprites. You could do that by having engine functions to do it, or engine functions that return a grid of pixel positions etc. Also, you'll still need sound and music, so think about ways to handle that as well.

Multiple windows could be nice too, so sprites are clipped as the move off one window, rather than appearing half in one, half in the other etc.

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 18th Jun 2004 20:03
you asked this over at pb as well...
effectively speaking; in order to do something like DirectX you need direct access to the system devices.

DirectX works in 2 ways:
1. Multimedia Library (Direct3D - 3D Library)
2. Product Driver Support

Basically put and i'll again use Direct3D as an example here, you would make a command which created a cube it is then the graphics card developers job to take the template of what you've created and build a car specific function, by adding in gpu addresses and such.

OpenGL is even more like this as each driver themselves make a driver function for a globally declared function.
(which means more optimisation possible, but also better 3d knowlage needed)

It's that Give<->Take between the API and Hardware Developer which has made Direct3D and OpenGL the most successful Graphics APIs.
You got better information on pb.com

M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 18th Jun 2004 22:07
I didnt get a reply on PB.com

flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 19th Jun 2004 16:47
Quote: "So whats the deal with 256p games? What can you do with 256 colours that you cant with a few million?"


The main thing is that each of the 256 colours is actually a 24 bit colour, that is stored in the Colour Look Up Table (CLUT, oh so close to slu...). The cool thing is that you can change the values of these colours and thus every pixel on the screen in that colour is changed, so you can do cool effects like weapon fire and waterfalls and stuff. I found it to be quite a learning experience to learn to deal with only 256 colours, and having to decide what the colours are used for.

M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 19th Jun 2004 20:58
Thats interesting, but with using DX8 Im going to be doing stuff like additive blending on particles and stuff like that, which when used correctly make great muzzle flashes...

BTW, I like your site, STIX sounds interesting...

DeepBlue
21
Years of Service
User Offline
Joined: 17th May 2003
Location: A little box in the UK
Posted: 19th Jun 2004 21:46
DirectX is probably your best bet if it's going to be run on Windows based machines. DirectX is a collection of API's:

DirectX Graphics - Previously DirectDraw[2D] & Direct3D[3D]
DirectAudio - Combines DirectSound & DirectMusic
DirectInput - Input Devices, Joysticks etc
DirectPlay - Multiplayer gamming over LAN,WAN,Modem etc
DirectShow - Multimedia ie mpeg, video etc

It's nice to have a range of API's that not only maximise your hardware potential but use the same structure which makes programming much easier.

I actually prefer OpenGL as a graphics only API, but it still leaves the problem of what to do about sound etc. It is of course multiplatform so if your programming in C/C++ for Windows & Linux/Unix etc life is easier. You still however have to hope that your graphics card fully supports OpenGL (Many manufacturers are make more of an effort on this front).

Your other alternatives are to use the basic Windows API calls, which is fine in some cases but kiss goodbye to your acceleration.

Or of course ignore Windows altogether and look at the newer VESA standards for cards (although yet again not worth it, lack of support & acceleration).

The coder formerly known as Twynklet.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th Jun 2004 22:26
Quote: "I actually prefer OpenGL as a graphics only API, but it still leaves the problem of what to do about sound etc. It is of course multiplatform so if your programming in C/C++ for Windows & Linux/Unix etc life is easier. You still however have to hope that your graphics card fully supports OpenGL (Many manufacturers are make more of an effort on this front)."


OpenGL + OpenAL is an extremely simple combination.
OpenAL is quite frankly one of the easiest APIs i've ever had the fortune to use

OpenGL however for Mac & Linux isn't quite as clean cut 'multi-platform' as everyone puts it.
The amount of people i've head having problems with the GLUT and GLX interfaces; Personally I find the both a pain in the ass too which is why i don't bother with OpenGL, because without Multi-platforming, i'm just giving myself extra work to do for no good reason.

Although I like C Style coding better than C++, it is alot more work to do it like that for anything larger than simple things.

I mean making Pong is very simply to do and track;
Making an FPS gets irrecivably more complex.

(and i could've sworn there was a post about this on PB which got a good response... guess it wasn't yours though)

DeepBlue
21
Years of Service
User Offline
Joined: 17th May 2003
Location: A little box in the UK
Posted: 19th Jun 2004 22:45
Shows how long ago I used OpenGl I'd better go invetigate OpenAL

Yep have to agree I find it easier in C than C++ as well.

Aargh had a lovely small 20-30line OpenGL Maze app in C including sliding collision can't find it on this PC (guess its on one of those hard drives on the floor..I hope).

I'll try dig it out as it's a very nice clean small example.

[Must remember not to sign Twynklet anymore ]

The coder formerly known as Twynklet.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Jun 2004 23:42
That still leaves the question of mouse and joystick access, networking and multithreading.

One of the best all-round multi-platform library sets around is Clanlib. SDL is another one that I know the name of, but have never tried.

There are others that cover a good proportion of a gaming system too, but you can always mix-n-match.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 20th Jun 2004 00:27
SDL is currently the best for Controls (and 2D) imo, but OpenML is comming along nicely

M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 20th Jun 2004 03:38
Sstarting with DX8 for graphics, what would be the best mix n match of libs for developing a 2d game? Im also considering Audiere as the sound/music engine. Control might also be DirectInput and Networking... Im not too sure about that

flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 20th Jun 2004 14:59
Quote: "BTW, I like your site, STIX sounds interesting..."


Thanks. I'll be posting more of my code soon. I'll put up the level system and full particle system code. I think I'll be able to have a demo out soonish, so look out on the work in progress board for it.

Login to post a reply

Server time is: 2024-11-25 11:35:31
Your offset time is: 2024-11-25 11:35:31