28-08-2009, 11:00 PM
Hi there,
Some of you may still know me from the old Elysium forum where I was the one who created the fast but admittedly quite featureless Asgard Engine.
I'm right now playing around with Asgard2 (A2 for short) and need some feedback. There's no release yet, you will get that when it's done. =)
What I need is some ideas about what I already have and maybe some comments and criticism. And maybe some hype if you like what you read. *g*
Anyway, the engine currently has:
- DX8 based UI system
- DX8 based widget system
- DX8 based sprites
- enhanced graphics with true alphablending (taking into account your image's alpha channel) and advanced texture blending effects
- animations (configurable, reusable, independent from all spritesheets)
Here's how the widget system works:
A2 does away with all of the ugly Windows forms and buttons. That's right, no longer will you have to use grey forms or ugly hacked together boxes. Instead, there are now DX8 rendered widgets that support special effects (alpha/textureblend) and their own transparent color and custom background. Configuring such a widget is really easy, too. 1 line of code, 2 if you want it to be draggable with the mouse cursor. One placed, a widget will automatically draw itself and generate appropriate reactions to clicks and mouseovers. Custom event handlers take only 1 if statement.
Imagine a draggable, partially transparent, animated inventory that won't cause the screen to flicker or leave artifacts. That's what it is capable of.
The UI system is basically what initializes the widget system and catches windows events for the game and the widgets. It is pretty small, hooks into the normal event calls and translates them properly to the DirectX8 game screen. As you may have read before, A2 doesn't use Windows forms anymore for its GUI. (Alright, it does for editing but for nothing that is supposed to look pretty and never be seen by users, only developers.)
Next is the sprite system. This abstraction layer provides easy access and configuration for sprites. Ever looked at the sprite routines in MS? Yes? Found them readable and easy to maintain? Yeah, me neither. That's what this is for. Load any spriteheet, set height and width of a frame, the number of frames and you're ready to go. All other information is automaticallly generated and added, maintained and modified. Probably don't have to mention this but sprites are dynamic. Just pass the size as parameter and the game will know to handle it. Sprites just work.
The animation system is quite similar. It allows you to define animations. What for? Well, there are already 4 frequently used animations. Walk up, walk down, walk left and walk right. Yeah, those are what I'm talking about. Now you can create your own animations for any situation you want to. Make an item that lets characters dance, a swordfighting skill that lets your character show off his ultra 112x combo or areas where players move different. Animated items? No problem since those use the new sprite system as well. (To be honest, the animations are not yet tied to other stuff. They are completely coded but not integrated with items and spells... But they will be, promise.)
To tie sprites and animations together, there's the new entity system. At first this may sound strange and confusing. It is not. An entity is essentially a combination of a sprite, an animation and some little tidbits of other information. The purpose? Being there. Entities can automatically perform predefined animations and animation with any sprite of your choice. Entities are basically all graphical "game objects". Players, Monsters, NPCs, Items and so on. Once created an entity will stay on screen where you put it, redraw itself when appropriate and perform it's assigned animation logic (which consists of one or more of the aforementioned animations.)
Here's some code as a preview, this is where I probably need the most feedback so please comment:
The entity we just created will now periodically draw itself, change it's animation frame if possible and take care of it's own positioning. It supports alpha blending, too! =)
Alright, now that I gave you an overwiew, please help me improve it. I am putting a lot of work into these frameworks and I definitely want them to be good.
Greetz, Atlantis
Some of you may still know me from the old Elysium forum where I was the one who created the fast but admittedly quite featureless Asgard Engine.
I'm right now playing around with Asgard2 (A2 for short) and need some feedback. There's no release yet, you will get that when it's done. =)
What I need is some ideas about what I already have and maybe some comments and criticism. And maybe some hype if you like what you read. *g*
Anyway, the engine currently has:
- DX8 based UI system
- DX8 based widget system
- DX8 based sprites
- enhanced graphics with true alphablending (taking into account your image's alpha channel) and advanced texture blending effects
- animations (configurable, reusable, independent from all spritesheets)
Here's how the widget system works:
A2 does away with all of the ugly Windows forms and buttons. That's right, no longer will you have to use grey forms or ugly hacked together boxes. Instead, there are now DX8 rendered widgets that support special effects (alpha/textureblend) and their own transparent color and custom background. Configuring such a widget is really easy, too. 1 line of code, 2 if you want it to be draggable with the mouse cursor. One placed, a widget will automatically draw itself and generate appropriate reactions to clicks and mouseovers. Custom event handlers take only 1 if statement.
Imagine a draggable, partially transparent, animated inventory that won't cause the screen to flicker or leave artifacts. That's what it is capable of.
The UI system is basically what initializes the widget system and catches windows events for the game and the widgets. It is pretty small, hooks into the normal event calls and translates them properly to the DirectX8 game screen. As you may have read before, A2 doesn't use Windows forms anymore for its GUI. (Alright, it does for editing but for nothing that is supposed to look pretty and never be seen by users, only developers.)
Next is the sprite system. This abstraction layer provides easy access and configuration for sprites. Ever looked at the sprite routines in MS? Yes? Found them readable and easy to maintain? Yeah, me neither. That's what this is for. Load any spriteheet, set height and width of a frame, the number of frames and you're ready to go. All other information is automaticallly generated and added, maintained and modified. Probably don't have to mention this but sprites are dynamic. Just pass the size as parameter and the game will know to handle it. Sprites just work.
The animation system is quite similar. It allows you to define animations. What for? Well, there are already 4 frequently used animations. Walk up, walk down, walk left and walk right. Yeah, those are what I'm talking about. Now you can create your own animations for any situation you want to. Make an item that lets characters dance, a swordfighting skill that lets your character show off his ultra 112x combo or areas where players move different. Animated items? No problem since those use the new sprite system as well. (To be honest, the animations are not yet tied to other stuff. They are completely coded but not integrated with items and spells... But they will be, promise.)
To tie sprites and animations together, there's the new entity system. At first this may sound strange and confusing. It is not. An entity is essentially a combination of a sprite, an animation and some little tidbits of other information. The purpose? Being there. Entities can automatically perform predefined animations and animation with any sprite of your choice. Entities are basically all graphical "game objects". Players, Monsters, NPCs, Items and so on. Once created an entity will stay on screen where you put it, redraw itself when appropriate and perform it's assigned animation logic (which consists of one or more of the aforementioned animations.)
Here's some code as a preview, this is where I probably need the most feedback so please comment:
Quote:' creating a widget, this is the character info and stats base window (the one with the bars)
Call A2_createWidget("charinfo", "", 0, 0, 64, 272, "charinfo.bmp")
Call A2_setWidgetDraggable("charinfo", True)
' sprite and animation code demo
For i = 1 To MAX_SPRITE_TEXTURES
' create our character sprites. Looks similar to the old mechanics, eh?
Call A2_createSprite("sprite" & i, 16, 32, 32, 32, 12, i & ".bmp")
Next i
' create animations. the 2. and 3. parameter specify the start and stop frames, the 4. chooses an
' animation behavior. 5th is one of two speed factors you can adjust if you want automatic animation
Call A2_createAnimation("walk_up", 0, 2, LoopAndDefault, 1)
Call A2_createAnimation("walk_down", 3, 5, LoopAndDefault, 1)
Call A2_createAnimation("walk_left", 6, 8, LoopAndDefault, 1)
Call A2_createAnimation("walk_right", 9, 11, LoopAndDefault, 1)
' now we can combine those into an entity, this will take care of any drawing
my_ent = A2_createEntity(25, 32, A2_getSpriteByName("sprite1"), A2_getAnimationByName("walk_down"), 1, 255, 1)
The entity we just created will now periodically draw itself, change it's animation frame if possible and take care of it's own positioning. It supports alpha blending, too! =)
Alright, now that I gave you an overwiew, please help me improve it. I am putting a lot of work into these frameworks and I definitely want them to be good.
Greetz, Atlantis