Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    8
  • comments
    20
  • views
    8176

WIP 5 -- Transparency Woes, Debugging and Refactoring

Sign in to follow this  
studentTeacher

938 views

[font=arial][size=2]Hey![/font]

[font=arial][size=2]So I posted the mid-week update of my transparency work earlier this past week. The results looked nice, but shortly afterwards, I realized I had some memory issues and it became a mangled mess. What was happening was I had my INDEXARRAY pointing to the array of indices stored in a VertexBufferObject in the mesh. When I passed that same array to itself for copying, weird glitches and a lot of memory access violations occured, mangling the meshes pretty bad. I cleaned that up, and fixed some of my sorting code to only perform sorting when crossing a block boundary (x-, y-, or z-plane). There's quite some optimization to be done there, but for now, it's good![/font]

[font=arial][size=2]Two things popped up during this process this past week however, and I need to address those before getting too deep into the engine. The first is Debugging. Currently, I have the most simplest form: logging. This has been fine so far, albeit with some print statements here and there while ironing out details, but when it got to the point of debugging some of the finer issues of transparency debugging, I realized my setup isn't ideal. The main issue I had was the lack of a "needle" to poke around into the executable. I wanted to peek in, grab a variable, change it's value, and see what happens. I wanted to set up the game at a certain point and see how things traverse from there. These are all useful things for debugging various features, now and later.[/font]

[font=arial][size=2]I also ran into the issue of transparency causing such a big change to the engine. I hacked this solution together; great! But now I have to clean it up. That'll take some time! I need to work on a better habit of programming in order to handle the situations of big structural changes with better ease. I'll have to try different things and see where I end up.[/font]

[font=arial][size=2]All in all, this experience was a wake-up call. I need to work on a couple tools before moving forward (luckily I've got quite some interest in these tools!) and then focus back on gameplay. Looking ahead at some big changes (World generation, chunk state management, disk handling, etc.) this change and these tools can be very instrumental in creating a good system. Heck; what's an engine without it's tools and flexibility???[/font]

[font=arial][size=2]And here we leave at what to work on. I'll be working on incorporating an HTTP server into my engine, in order to flesh out debugging and feature addition. This will be a simple data server coupled with a couple HTML pages for displaying and manipulating data. These have been done before and I'm looking for good libraries and examples, so I'm hoping this won't be a terribly long diversion! Once it's done, onto more memory related things (disk I/O, paging, world gen, etc).[/font]

[font=arial][size=2]Best,[/font]
[font=arial]ST[/font]
Sign in to follow this  


4 Comments


Recommended Comments

Your tiny font hurts my eyes smile.png

 

It wouldn't let me make it bigger :/ I changed the font size multiple times....It's something to do with copying from a word doc (first time I did it).

Share this comment


Link to comment
The editor is a nuisance. Even the preview can screw things up. I almost never use WYSIWYG but switch to raw view (BBCode mode).

@Aardvajk: Ctrl+MouseWheel to the rescue.

On-topic: Hmmm, handy debug functionality is a must. I don't have such intrusive stuff (yet), but so far the VS debugger and C# reflection came in handy. I'm also a big fan of logging, but I do use HTML logs instead of pure text and an abundance of reporters (e.g. dump a read-back GPU-texture/buffer as a table). But for graphics usually nothing beats a good graphics debugger (I still use PIX).

Share this comment


Link to comment

The editor is a nuisance. Even the preview can screw things up. I almost never use WYSIWYG but switch to raw view (BBCode mode).

@Aardvajk: Ctrl+MouseWheel to the rescue.

On-topic: Hmmm, handy debug functionality is a must. I don't have such intrusive stuff (yet), but so far the VS debugger and C# reflection came in handy. I'm also a big fan of logging, but I do use HTML logs instead of pure text and an abundance of reporters (e.g. dump a read-back GPU-texture/buffer as a table). But for graphics usually nothing beats a good graphics debugger (I still use PIX).

 

 

Luckily my graphics issues were on the CPU end :D So this made debugging easier. I'm also going to need something that picks at my engine since I'm apparently bad at writing logs and profiling (something like a webserver lets me pull data where and when I want). It's all a learning experience anyways, and this is a hobby, so there's no rush for me. Take my time, and in the end I could have a freaking sweet engine or tool suite to share with the world :)

 

I'm at a good point to make these tools (engine's pretty fleshed out, almost at the point of no return, so a big change like this should come sooner rather than later), plus I'm a senior about to graduate, so some cool tools like this can flesh out my web development side for interviewing and programming examples. 

 

The nice thing is I started playing around with Node.js and the V8 engine, and I can get it all working with a webpage fairly easily (I've already cone a chat program that exchanges messages and objects with C++ code, and even logs on the server's side in C++ using my logger)! My engine will just be a library to make calls from with the JS code -- so I also now have a simple-to-use scripting language, which I was planning on from the start :) It's a win-win situation. Now to write it....that's my task for the next couple weeks.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!