Well here i am at 3 am (freezing my ass i might add) sobering up from after work drinks and posting my life story (well not really that would be boring
).
Any way for thoses who have not meet me before my name is mark (in game name lodle or johnyb depending on the game) and i come from the little place you yanks like to call down under (not that any of you know where it is to start with). My chosen field of occupation, as i like to call it, is the humble programmer. Im quite lucky really, with scott of having fun in data centers along the west side of USA and mario QA'ing the hell out of ea i had the title of lead and only coder slapped on me. So i thank you all for that
.
Now thats enough ramble about me. Lets talk business. Recently i had the fun of recoding the health and amour bars in ges. My god was that harder than it looked. The old ones where really a freak of nature and should never of seen the light of day. Trying to align and change 10 different pictures in a nice curve is like trying to swallow a chain saw while being sprayed in the face with mace. Put it simple it looks shit and is a pain in the but to work with.
Now i stumbled along this nice little function that takes to images and a percent value and draws % of the first one with 1-% of the second one. Wow, 1 line of code to draw the health bars and it worked very well except one thing. The health bars we wanted are curved so this would mean that it would still have the last little bit of the box above showing, which in the end looked shit.
So now the challenge was to find a way to splice the images together on an angle. So i started looking through all the drawing functions and one sparked my eye, DrawTexturedPolygon. Now this little beast was exactly what i needed but i had no idea how the hell it worked. So i googled it, nothing, looked in the src code for other examples, almost nothing (the one found was so complex (radar) that i gave up learning how it worked. So i did the next best thing, trial and error. After the 10th rebuild I got a picture to render using it and i was so happy
but dark times where still ahead.
I got a square to render which was the easy part and so i tried to skew it into a ... dam forget the word .. funny skewed, not so square, dovalacky (that will do) but the texture was stretching in a weird way cause i still didnt understand how it worked. Any way i left it at that and went off to work and then right in the middle of pooring my 99th pint of weinstephaner (very good German beer, and yes i am a bar tender by night) it hit me, the fact that the second set of points that DrawTexturedPolygon where unitvectors to define what part of the image was drawn.
With this knowledge i went back to the code and after 9 hours, 201 lines, 56 rebuilds, 7 sheets of scribble and 23 stupid errors they where working like a charm. I would love to show you them but sean said no. ( he is such a meany at times ).
Well thats the end of my rant for today.
When will i post next? Any ones guess. So ttul
Oh btw feel free to ask questions about what i blog as well. And a special thxs to my yr 11 math teacher Mrs Scar (yes her real name) with out her skills of teaching i would of been lost.
Mark "Lodle" Chandler
Lead Programmer