Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 16 Jun 2011
Offline Last Active Jul 03 2015 09:35 AM

Posts I've Made

In Topic: trouble parsing quake3 md3

04 April 2015 - 02:18 PM

Thanks for the suggestions. Figured it out by programmatically walking through the bytes looking for sane values for NUM_FRAMES, NUM_TAGS and NUM_SURFACES. Crude but effective. Code sample in case anyone else needs help figuring this out later on...

import binascii
import struct

filename = 'head.MD3'
bytes = ''
with open(filename,'rb') as fileptr:
    bytes = fileptr.read()
bytes = binascii.hexlify(bytes)

def test2(bytes, start):
    for x in range(0,512):
        hexstart1 = start+x
        hexstart2 = start+x+8
        hexstart3 = start+x+8+8
        hexstart4 = start+x+8+8+8
        hexstart5 = start+x+8+8+8+8
        hexstart6 = start+x+8+8+8+8+8
        hexstart7 = start+x+8+8+8+8+8+8
        hexstart8 = start+x+8+8+8+8+8+8+8
        NUM_FRAMES = struct.unpack('<I', bytes[hexstart1:hexstart1+8].decode("hex"))[0]
        NUM_TAGS = struct.unpack('<I', bytes[hexstart2:hexstart2+8].decode("hex"))[0]
        NUM_SURFACES = struct.unpack('<I', bytes[hexstart3:hexstart3+8].decode("hex"))[0]
        NUM_SKINS = struct.unpack('<I', bytes[hexstart4:hexstart4+8].decode("hex"))[0]
        OFS_FRAMES = struct.unpack('<I', bytes[hexstart5:hexstart5+8].decode("hex"))[0]
        OFS_TAGS = struct.unpack('<I', bytes[hexstart6:hexstart6+8].decode("hex"))[0]
        OFS_SURFACES = struct.unpack('<I', bytes[hexstart7:hexstart7+8].decode("hex"))[0]
        OFS_EOF = struct.unpack('<I', bytes[hexstart8:hexstart8+8].decode("hex"))[0]
        if NUM_FRAMES < 1024 and NUM_FRAMES > 0 and NUM_TAGS < 16 and NUM_TAGS > 0 and NUM_SURFACES < 32 and NUM_SURFACES > 0:
            print hexstart1
            print '~~~~~~~~'

print len(bytes)/2



1 1 1 0 108 164 276 3284

In Topic: Error handling

19 May 2014 - 10:30 PM

The company I work for basically makes a server that is a polling engine...so every time you allocate memory, convert something or call a function you check for success or failure. If you can continue on failure you fail over to another path if possible. When something happens (error, warning, status or information change) it is pushed to a log service. The log can be filtered for LOD and viewed in real time as well as be pushed asynchronously to file. If viewing the log through client you can reference objects it is related to (and eventually help). I would concentrate on making try catch blocks as discrete as possible and check everything before you use it. Investigate boost pointers. Structure code so if one thing fails you aren't screwed. Make your logging as rich as possible. A big thing that seperates us from competition is that you can identify problems....communications path, device and host problems with the log. Then if you have a support contract you can email it to us for help.

In Topic: What good OpenGL book do you recommend for beginners?

19 May 2014 - 05:32 PM

I know you asked for OpenGL...WebGL is pretty close.


WebGL uses OpenGL ES1/2 standard and the equivalent GLSL embedded language. It sacrifices some power for portability (much easier to share with friends since it can run on your smart phone even through a web browser HTML5 context) This is an excellent book and a great introduction...




Why WebGL and not OpenGL? It's a LOT easier to show off to your friends because you don't have to send a binary. Just upload it to Google Drive (a little tricky but possible to view it as a web page and not a file) and send them a link.


Good luck.

In Topic: advice for a web service based game w/ mobile clients

19 May 2014 - 05:23 PM

Thanks for the posts all...I'll resurrect this when I get somewhere.

In Topic: Are games still generally linear or open world?

20 March 2014 - 06:47 PM

I think the trend is more towards non-linear...but I'm biased. Some people like linear, simple worlds, others like to explore. Personally I like the ones that give you a choice like Splinter Cell...there are several paths to follow...with those sort of games you can choose to sneak by everyone or you can choose to kill your way through the level so long as you stash bodies neatly.