3D Game Engine From Scratch

Here are some pictures of the 3D Game Engine I’m developing. I made it all the way from scratch using only plain old Java. (Don’t ask me why, I did it because I can).

I’m not the most experienced programmer. I have about a year experience with java and a year and a half of object oriented programming.

Any ideas, suggestions or usefull articles are welcome. Feel free to give some feedback.

Currently I can rotate from left to right, up and down and I can walk around. I have the ability to make some objects and place them in the world. That’s about it :wink:

UPDATE:
I’ve been working a few hours last night and today to clean up the code. I’m now starting my list of features I want to implement. As soon as I finish my list I’ll see if I can upload it so you can download it.

I have a laptop with an AMD quad core 2.3GHz Processor, AMD Radeon 1GB dedicated VRAM graphics card and 6GB RAM.
I can reach up to 130fps sometimes, but generally it runs between 60fps and it’s cap 111fps. It runs on 60 ups.

Cool! It’s a real challenge to tackle writing an engine. Just to warn you: if you want to make games, don’t start with making an engine. Creating an engine will eat up a year or two of development and get you not as far as the already established engines. That being said, it is a great way to learn about the inner workings of games and the engines that power them. The knowledge you gain from it will help you down the road.

Thanks for the advice! I know it’s indeed ambitious to start with an engine right away, but I already learned a ton of it. I’ve had some experience making games in java and C#, especially 2D games. I also worked with some engines, but I’m very eager to learn make games from scratch including their engines etc. that’s why I started this project. I thought it would be usefull to post it for some help and motivation to finish it.

Is it open source?
VERY cool by the way, this is really impressive.

Not yet, it’s still in it’s roots. I have a little checklist in my head and when most of that is done I’ll put it online. There are still a few issues I need to resolve before releasing it.

Pretty cool engine youve got there. Using java2d correct?

Also, the [img] tags should work if you put the url inside of them. If that doesn’t work, try uploading to imgur.

It’s very cool that you’re using Java2D for this, at first I assumed it was done in OpenGL, and I wasn’t too impressed, but then I realized my mistake! Good job!

Just plain Java ;). It took me about 3 weeks to figure out how to work with matrices and stuff. Then it took me another 3 weeks to build it as far as I am now. Long live wikipedia and google :stuck_out_tongue:

Oh, matrices suck, I seriously despise them! I’ll have to eventually learn them someday, but I’m very impressed you learned them that quickly :slight_smile: Very good job, I can’t wait to see what else you can do!

http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html

Very nice. Can you post your system specs and the fps you are achieving? Just can’t believe that Java2D can be that fast to tackle a 3D engine. Good luck with your project.

Very impressive, look forward to seeing how far you take this. Huge challenge to set yourself!

Why shouldn’t it? Softwares renderers for Java exist for ages. On a current i5/i7 machine, you can render a fully textured Quake3 level in 1280*1024 @ 30-60fps in software.

I have a laptop with an AMD quad core 2.3GHz Processor, AMD Radeon 1GB dedicated VRAM graphics card and 6GB RAM.
I can reach up to 130fps sometimes, but generally it is between 60 and it’s cap 111fps. Meanwhile it runs on 60 ups.

Sounds like you have a list of features that you’re planning to investigate, design and implement all at the same time - big challenge! but an interesting one.

Having attempted to do something very similar myself (3D using OpenGL) one approach I would suggest is to follow an iterative development style:

Decide what feature(s) you’re going to deliver next and stick to it. Once you’ve got the next feature up-and-running have a pause and take the time to:

  • tidy-up your code and documentation or notes.
  • extract any generic code into reusable classes/packages that can be used elsewhere (and checking you haven’t broken anything).
  • re-review your list of features, you might have to change the order or priorities depending on what you’ve learnt.

I like to call this the perspiration-then-consolidation approach :wink:

  • stride

Hey that’s a good one! Thx for the advice.

What kind of performance tests have you done . Good ones are where you set it to render a certain number of verticies and then check the fps.

Also what do you use to render is the render function for your objects called in a tick function?

Well , that just changed my perception on matrices, thank you very much!!

I haven’t done alot of tests, however I have tested it on performance when using a load of vertices. When the amount of vertices increases significantly (and then I’m speaking about hundreds of thousands) the framerate starts to drop. However when using 5 grids (so that is 20 * 20 + 20 * 10 * 4 = 1200 points in the case of the pictures in my post) it doesn’t effect the performance alot.

How are you going to do the rasterization its currently what im stuck on.