Man ... I'm on fire tonight!
Miscellaneous Forums/General Discussion/Man ... I'm on fire tonight!
Well not literally, just metaphorically.
Been really getting into Max and OOP and have totally optimised my whole Game Framework into more polymorphic types so that my main demo code is only 200 lines long. All the magic occurs in the other framework files. It feels so satisfying to see a Select Case code block and realise that you don't need it because you can just use a pointer to a type and call one of its methods that will either use a default or an overridden one in an extended type. I've practically got my code down to no functions and no globals, it's pretty neat now.
Max still rocks, so easy when you get into the flow.
Gotta hit the sack now, kids up in 6 hours, doh!!
Well not literally, just metaphorically.
You brought me in here for THAT?!?
i didnt understand a word he said. Mostly cause i dont understand Max
sounds .... advanced ^^
I love it when I get in the groove like that, good for you!
well I'm definitely quenched this morning, yawn. You always pay later for those kinda burns. Anyway orders still keep coming in for the framework so the hard work is paying off :-)
I've practically got my code down to no functions and no globals, it's pretty neat now.
- I don't understand that at all Grey Alien? I've never really programmed OOP style though - how does it work - don't you have some kind of 'main loop' where you call functions like "UpdateThis()" and "UpdateThat()" along with some "GetInputFromUser()"?
When I said no "functions", that's because everything is now "methods" of objects instead. Here's my main loop:
Repeat
'do the logic separately from the drawing
If Game.MainLogicLoop() = -1 Then ShutDown()
'draw the screen and flip it to show it
Game.ScreenDraw()
'This line lets windows have some CPU power but reduces the overall FPS,
'so you may want to comment it out.
If Not Game.FullScreen And Not Game.Fast Then Delay(1)
Until LoopExit = 1
yes, I know Shutdown() is a function ;-p That's why I said "practically".
What are the differences between a function and a method?
How is "Game.MainLogicLoop()" different than calling a function like "MainLogicLoop(Game.GameType)"?
I love it when I read about three sentences of a topic, have no idea what's going on and then post at the bottom like this.
so do I, however I complety understand everything.
Game.Fast
LOL
How is "Game.MainLogicLoop()" different than calling a function like "MainLogicLoop(Game.GameType)"?
question is why would you want to do it the other way, its complety OOP negitaive*.
ShutDown()
Why dont you make it a function inside the type, that way it would be better (I was gonna thing of somthing but It lost me :()
EDITs it just came back to me, it would be better because you might have another function called shutdown that dose somthing else.
This is the main shutdown function, it applies to the entire app, not just Game.Shutdown (which doesn't exist anyway in my framework)
Function Shutdown()
CleanUp() 'Free up memory
'Exit the program
End
End Function
Cleanup is a legacy from my BlitzPlus days. In theory it cleans up any globals that weren't part of types, except that these days with auto GarbageCollection, you don't need to. I've left it in in case anyone wants to process anything (like saving stuff) when the game is shutdown.
I was just saying that this is the same (in my books):
Function Shutdown()
CleanUp()
End
End Function
Type TGame
' ...
Function Shutdown()
CleanUp()
End
End Function
End Type
Cleanup is a legacy from my BlitzPlus days
I never got plus so I would'ne no.
Also there is OnEnd() - which I never use but...
EDITZ: any way get back to coding... I've wasted enough of your time.
OnEnd sounds good.
But anyway the point of having shutdown outside ot TGame is to clean up globals *not* associated with TGame. Putting shutdown in TGame wouldn't be clever as it would access non TGame globals which is crap. that's why I did it :-)
makes perfect sense.
Now get back to work before the firemen/women (XD) come.
cool stuff...
when do you think you'll be finished with the Game.MakeGenre(Racer) method? I think everyone is waiting for that one.
I'm sure you mean:
TGame.Make(TGenre.Make("Some kind of game were you kill stuff, but it has to look really koool and must have bullet time effects, of course"))
TGame.Run()
TMoney.Take(TYou, "$100") ' meh
lol
when do you think you'll be finished with the Game.MakeGenre(Racer) method? I think everyone is waiting for that one.
well after TGame.MakeGenre("totally wicked RPG") and TGame.MakeGenre("the best platform game ever made") and TGame.Make3DEngine().
Personally I'm waiting for Game.MakeMoney() with bated breath. Certainly Game.SellEngine() seems to be doing OK ;-)
It might be even harder to produce, but if you could add a Game.Polish("AAA") to the mainloop, we'd sell more games :D
lol, good one. I'm also going to make Game.BigFishTop10.Insert(). Of course BigFishTop10 will be a TPortal type and you'll be able to extend this to ReflexiveTop10 and RealArcadeTop10 amongst others.
Actually, the framework is pretty popular, if it carries on like this, it'll make more money that Easter Bonus :-O
Actually, the framework is pretty popular, if it carries on like this, it'll make more money that Easter Bonus :-O
mmm.. I would buy it, however I prefer to learn stuff. And also my bank wont let me spend any money till I can prove who I am ?(
Well thanks for the vote of confidence anyway. I can understand wanting to learn it but believe me it was pretty painful researching and coding all this stuff, I wouldn't wish the same on anyone ;-)
i didnt understand a word he said. Mostly cause i dont understand Max
What Grey means is that he completely object-oriented his framework code. If you don't understand Blitzmax OOP, try reading this tutorial:
http://www.blitzbasic.com/Community/posts.php?topic=59233 How is "Game.MainLogicLoop()" different than calling a function like "MainLogicLoop(Game.GameType)"?
There is no difference between the behaviour of "Game.MainLogicLoop()" and "MainLogicLoop(Game.GameType)". The difference is that "Game.MainLogicLoop()" is more readible and easy (which is what OOP is really all about).
now hes burining literally and metaphorically(i think, still dont know what he said.) lol
LMAO! :D
Dabz
lol @ sswift: except I didn't look worried, I was enjoying it. Actually I probably looked tired.
btw I endorse John's tutorial. John is it OK if I put a link to it in my Game Framework FAQ?
I love it when I get in the groove like that
I love it too. One of the big mysteries of my life is why I am so reticent to start working on a programming task or 3D model. It takes me forever to muster up the energy to start, but once I start I am almost always riding a wave of bliss.
I understand how you feel. I've done the same when I made my Geometry Wars clone. Made a decent framework. Now, my next game is going very quickly, code wise. I've never been this productive. Getting functionality into isolated objects which you can add or remove from your program with ease is awesome.
plug n play coding!
you still on fire? don't burn out on us! .. seriously :) please think of the children!
GOOOD MAN GA!!!
OOP is da joint... everything else is a waste of effort!!!
-- that'll be sure to bring a barrage of spitballs my way :) --
Keep On Burnin' Dude...
--Mike
Red: Ditch the 3D crap and get into Max, the OOP is more fun than trying out every 3D engine under the sun like you are on some kind of government research grant ;-D
:) as soon as i finish up one or two things... i'll be right there with ya...
--Mike
John is it OK if I put a link to it in my Game Framework FAQ?
Of course you can, I don't mind :)
sswift: lol :D
thank's John. See it's in your sig now, cool.
just been playing Quake 4 some more. I dropped the res to 640x480 and quality to medium and turn of specular highlights (what is that anyway?) switched on Vsync and finally it looks ok, it seems to render everyframe instead of being jerky and crap. It was half decen fun-ish.
@Grey: Red: Ditch the 3D crap and get into Max, the OOP is more fun than trying out every 3D engine under the sun like you are on some kind of government research grant ;-D
LOL ;--D
@red: Don't take offense, I've seen your posts of your sub project and have been impressed with your snaps so far..... It's just I've a habit of flitting from one development language to another myself - b3d is my main source of 'fun', variety is the spice of life though ...