About this blog
The ups and downs of a self taught programmer.
Entries in this blog
Days at work are getting longer and longer... hopefully I get some more done tommorow.. well good night
Well today was my birthday and so I decided to play some World of Warcraft with my bro and I went out with family... anyway back to work tommorow and time to get back to my game.
Well I have a working video/sound/event system. I think its time I make a simple game like hangman or something to test it all out. So now I will be working on hangman using this simple engine. After that I will do some more work on it then probably make another game.. What iam hoping the game will do is show me my desgin flaws so I can change them and fix them.. well thats all for now
omg I actually got a work event system HELL YA.. woot... omg I feel good... I have a werid screen update issue with it but thats fine i just have the video at the end of the handle event update screen instead of the system loop...time to do more testing
Also i fixed the updatescreen issue.. Seems during my editing trying to get things to work I deleted my updatescreen call from my main loop...so thats fixed
All i need to do now is have each class register itself automatically.. Iam sure I can do it through the class constructor... not sure though.
Well this idea is coming along... Its a slow process as I have been really tired after work these last few days and when I wake up in the morning Ive had to fill out a lot of paperwork. The paperwork is done so now work should pick up a bit before I go to work which should be good.. well good night all and good luck programming/drawing/watever you do
Well Iam tired as hell long day at work.. but I did a lot of thinking today about my engine and if I wake up on time I should be able to get some good stuff in.. I dont know whats up but the last couple days I have had a very clear head about all this... Iam loving it.. it will be gone soon though lol
Well I didnt do any programming yesterday. I did think about the event handling system a lil bit but I think I cracked it
I just need to setup a stack/vector or something to hold all the diffrent interfaces that have events.. like menu - playgame - character and all that jazz.. But I figured out a way to hide the implmentation of SDL and still have it work well... Ima think about putting a bind system in so you can bind keys to the diffrent events.. we shall see.
I owe thanks to the event handling article. though iam not doing it the exact same many things taht have been made are modeled after what it did...
I dont want to give up on anything i start with programming cus that just lets me take the easy way out. But I just dont know how revlevant making a event system is to wnating to become focused on network programming. It is probably fairly invloved but I dont know. I want to get into the network programming and such and work on that but I dont want to give up on what I have set for my goal as of right now... just dont know what to do... maybe take a break and work on the network stuff for awhile then come back to this? I dunno any advice would be great
well i fried my brain on the SDL event system today... I didnt get anyhting acomlpished toward my goal but i found a dirrent way to handle holding down a key then has been shown in all the examples i have seen on the net..or atleast it seems diffrent
anyway tme to sleep maybe ill be able to do something useful toward the engine tommorow
Well for some reason Iam just not able to get my head around a Event handling system. Been reading docs and articales all night and man my brain is frying. It is on the tip of my mind i can feel it i just cant bring the concept in completly.. ill start with something and then ill be blank again.. I cant belive a simple eventhandling system is killing me!...
It uses SDL for the video
It uses SDL_mixer for sound
The network API is undecided yet
I was thinking that this first version will be based for simple pen and paper/board games.. Or I might build it up so it can do a full scale RPG
Video system class to do all the inilization and drawing to the screen as well as tracking the x and y of each surface(this may change)..
A surface class to do all the loading and and setup of the surfaces that will be dealt with.
Audio system class that plays and initlizes sounds/music
Effect class for loading and setting up sound effects
Music class for doing the same thing as effect but for music
Not much here
Currently the system class has the game loop/kernal(whatever you want to call it) but it dosent do much else
this is where Iam working right now and I plan on adding
a Event system to do all the event procesing. a Logging system to log errors and such. And a timer system to track all the timing stuff...
Ill keep you all updated and if I can clean things up i may post a screenshot even though it will be extremtly boring right now lol..
woot after tonights shift i have a day off time to get some work done hooray! lata all gota get this shft done
Was reading one of my C++ books at work today and found something that would help me a lot.. handt noticed it before but now that i have a firmer grasp on things it helps a lot to see stuff i didnt see when i knew nothing.. Its funny I was trying to think of a way to do this and it was a simple keyword lol. this is why programming is so great.. you always learn new things. well iam out to conquer more obstacales of my engine take it easy
[EDIT] haha VC++ 6.0 wont complie it
here is an example
static SDL_Surface* main_window;
Dunno if its VC++ 6.0 or iam not implmenting the static member right i dunno its late and i just worked all day ill get my book outa my truck in the morning..
What the book says static does is make that static member the same for all instances of the class which is great for making a min window in a video system class for SDL... but it wont compile.. ill re read teh section in the morning. night all
Well work is tiring but I have started taking my C++ books to work and reading them on breaks. I have gotten to understand pointers a lot better which Iam glad for because i remember reading somewhere that passing pointers to functions instead of the actual type is faster cus it transfers 1byte instead of 4(for a int). Iam going to try and find that again and clarify it.
Anyway work goes as normal on Engine. slow until works over but Iam trying to get some done. Still havent had time to actually tackle the coding of my event system. thinking about how exactly i want to do it. I think iam going to read through all of the SDL docs for events this weekend and then go from there. well take it easy eveyrone
Man these first few days of long hours are rough.. I hate the feeling like I didnt sleep after 7 hours of sleep. Oh well work goes on as normal hopefully this sunday I will be able to have a good enough version of my engine for a simple test game.. who knows well goodnight/goodday whichever you call it. take it easy.
Well Iam working on my event system today again. Its the last thing Iam having a problem with at the current time and it just dosent seem feasible to do the things I want to do.
Who would have thought hiding the SDL API complety from game code would be this much of a pain.
I have the system right now.. my engine has a video/drawing class, it has a audio class (these work fine the way i want to use them.) Then I have my system class which is going to handle all loading/saving and events and for now thats it but it is open to more.. But that dosent work with what I want to do which is have my player class access the system class event system. but instead my system class event system has to handle all the actions of the game like if w is pressed then do the game class action of move north or drop block(depending on game)
I just had a semi idea .. each part of the game gets its own system event and it jumps into that when the gmae is at that point likeyou have your map.system.event then if esc is pressed it goes to menu.system.event which is really just another message loop of its own... and it handles the event each way in its own way.. of course it seems like it would take quite a bit of wrapper work to hide SDL but this sounds like a pretty good idea...
Man I love these journals just writing that out gave me a idea i feel is good.. Iam going to work on that after work..
What do you all think.. am I just shooting off in the wrong direction? either way Ill find out I guess........ until next time
Well as is my current career a seasonal job I start today again. this job is 6-10s with sundays off(atleast its not 7-12s) so my programming is cut down majorly.. I was thinking about taking some paper and pencil to work and on break writing code and such but I dont know. We shall see how it goes hopefully my engine development still goes smoothly as it has.. maybe it will give me a chance to clear my head each day and I will be able to see new things I didnt see before. well Iam out gota get ready for work
Today Iam having fun trying to figure out a way to hide the implmentation of SDL in my engine while still being able to make it so my game uses my engine and not the other way around... I shall figure out a way soon i have no doubt but its still a pain