Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: {Build 1.2} XNA Zelda Engine - Link's Awakening Style  (Read 4879 times)

0 Members and 1 Guest are viewing this topic.
{Build 1.2} XNA Zelda Engine - Link's Awakening ...
« on: January 25, 2012, 05:31:08 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
XNA Zelda Engine
Created by Theforeshadower

Requirements:I believe only .Net 4.0 and XNA 4.0 redist
Current Features:BUILD 1.2
*Full 8 directional movement
*Fully animated 4 directions of movement
*Gameboy resolution
*Animated fully functional sword attack - Z key to attack
*Animated and functional basic HUD/ inventory screen - Enter to open/close
Under the Hood:BUILD 1
*Simple class hierarchy
*A sprite manager component that can animate sprites regardless if they have independent  update code or not

UPCOMING FEATURES:
*base tile engine
*optimized HUD and inventory
*start of the item coding
*overworld map
*enemies


« Last Edit: January 28, 2012, 01:59:41 pm by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: {Build 1.1} XNA Zelda Engine - Link's Awaken...
« Reply #1 on: January 27, 2012, 08:08:37 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
New build.  Contains sword attacking.  Decided to focus down to one small thing at a time.  There is a graphical glitch that happens when you swing the sword to the right.  Checked over my code a dozen times and cannot figure it out.  Only happens on that direction at least on my pc.  All the directional code is identical minus the obvious directional variables, so I may place this glitch on the back burner for now.

Anyway, feel free to give feedback thus far.  I would like to know how it runs across different hardware specs thus far.

Controls - Arrow keys to move: Z to swing sword.
« Last Edit: January 27, 2012, 08:11:41 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: {Build 1.2} XNA Zelda Engine - Link's Awaken...
« Reply #2 on: January 28, 2012, 01:52:42 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Fixed the right sword graphical glitch.
Added a new basic HUD.  Pauses Link and the Sword while opening,open,or closing.  This will be helpful as well when adding future features that are dependent upon whether or not to act with the menu open or not.  Glad how it turned out.  Just one technical thing to do and that is disabling a "loop" in the menu where if you hold down enter it continues to open and close.  Will be fixed on my end in about 5 minutes or so but I already packaged this build together...

Enter to open/close inventory menu.
« Last Edit: January 28, 2012, 01:58:40 pm by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: {Build 1.2} XNA Zelda Engine - Link's Awaken...
« Reply #3 on: January 31, 2012, 04:05:29 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
No new build but i do have a question: Which would be better, a tiled based engine or tiling the areas in another program and just saving as multiple images(ground layer, mid layer, highest layer) that are drawn for the background?  It's all in png and doesn't take up much space once XNA compresses it.

The reason i ask is that for the original engine idea, the tile engine seems to be a great idea.  I just have to learn how to read from files(more so spreadsheets).  That way I wouldn't have to store every room in one single cs file.
However, I have been doing some experimenting in another XNA project with a Minish Cap style engine.  It seems as though just having your entire background on one single image per layer would be best and quickest.  You draw the bottom and top(trees buildings) and anything you may need in between.

Maybe both are fine in their own right based upon the uses.  I should also look into writing a level editor but have really no idea where to start, so if anyone has a suggestion for that, throw it at me.
Logged
  • Super Fan Gamers!
Re: {Build 1.2} XNA Zelda Engine - Link's Awaken...
« Reply #4 on: January 31, 2012, 09:19:25 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 4
Id save the tiles as the bigger images, but also have another xml that defines the tiles. That way you can swap out tiles if you want without having to redo everything if you want to make changes to the tiles used. Also i don't think you should be making a level editor until you've got some more basic game elements in. Otherwise you'll be changing around your editor code every time you change your game engine code. Also you said that your going to make a class hierarchy, which imo is a tough choice to make. Id suggest a component based game engine design. basically you make objects out of components without giving objects unneeded baggage of their base classes. That way you can make some pretty complex enemies or something. It also allows you to hard code some components without much problem or bugs that you might get from making it hierarchy based.

http://gameprogrammingpatterns.com/component.html
Logged
Re: {Build 1.2} XNA Zelda Engine - Link's Awaken...
« Reply #5 on: February 01, 2012, 01:25:09 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
I already have a small hierarchy going on.  The classes are used to create one instance of an object eventually that is handled by ONE game component depending on what the object does.  I have a SpriteManager and a TileManager, both are actual game components.  One controls the sprite objects, the other controls tiles.

Even though I haven't posted it, I already have integrated the tiling component.  What need to be done now, is writing some sort code to read from files.  I have been looking over my C# book and not really turning up any leads thus far.  I can make it work by writing all the tiles out in a cs file.  However, this is not only time consuming, but once the engine is released open-source, I doubt people would want to go through the same process to make just a house let alone the entire overworld.

That is why I need to make a basic level editor where it will store the tile information into a file that can be loaded into the game.

Making everything a game component seems to defeat the purpose of OOP.  It would be that same as using Game Maker with only creating everything in it's own object instead of having parents that object inherit from.  I am not too sure but I also think that performance would also be hampered.

The way I have it now is quite simple.  The ideas I have will make it even more simple.  Everything that is a sprite draws it's variables from the baseSprite class.

baseSprite---------nonPlayer----------NPCs
||||||||||              |||||||               |||||
player                   Enemies               |||||
||||||||||               ||||||                |||||
Sprite Manager -------------------------------

Crude way of showing it but that is how it breaks down.  Where as if I did it your way, I would have to have at least three different game components: the player, NPCs, and enemies.  That means a new instance of a game component every time I created just say an enemy for example.  It may seem simple but it defeats the purpose of what I am trying to learn.  I can have all the objects(like I am doing now) created and controlled within the SpriteManager.

Hell, my Game1.cs has hardly any code whatsoever in it.  It just has the calls to create 1 instance of the Sprite and Tile Managers and load them to be updated....about 4 lines of code.

Just saying.  I may not know everything but from experience and what I have read in 4 books about XNA, doing everything in game components is bad.
Logged
  • Super Fan Gamers!
Re: {Build 1.2} XNA Zelda Engine - Link's Awaken...
« Reply #6 on: February 01, 2012, 05:14:34 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 4
Yes doing everything in "GameComponents" is bad, but I didnt mean "Game Components" from xna, did you read the article? Yes i have also read some c# and xna books too. Yes component based game design isnt OOP, its not supposed to be. Ive read a bit of articles on the design and it seems its better than doing strict OOP. Ofc you can have some kind of OOP design in the component design tho. My Game1.cs also has little code, only to add my component based engine to the components list - which imo isnt a good excuse for anything to be "good". It just means you put your code somewhere else. Im not saying to do anything in game components, im talking about a design pattern thats very different. I was just trying to give out some ideas, i mean ive also done a hierarchy designed engine, but component based design 'imo' is easier. 

Anyways, you can serialize/deserialize data into an xml. It does take some time to load up, but its user friendly and easy to read.  You can also load xml files as content into classes.

http://blogs.msdn.com/b/shawnhar/archive/2008/08/12/everything-you-ever-wanted-to-know-about-intermediateserializer.aspx

you can also just load in text files of your map. But then you'd have to parse it your self. There are other ways too, but ive only done txt files,xml, and multiple kinds of serializing. Xml being better, but slower.


An object would have an input,collision,physics, and render component. A player be an object, except with a "PlayerInputComponent" component. A npc would and an object, except with a "AIInputComponent".  No hierarchy, you get what you want and you can easily make complex objects.  They all are still controlled by the same sprite manager too if you want.
« Last Edit: February 01, 2012, 11:43:31 am by TheShyGuy »
Logged
Re: {Build 1.2} XNA Zelda Engine - Link's Awaken...
« Reply #7 on: February 02, 2012, 09:44:06 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
I understand now but I am not doing this engine that way.

Also, no new updates for a while as I am rebuilding this engine with a focus on Minish Cap rather than Link's Awakening.  Seems to be a better choice with regards to graphics and "room" management.
« Last Edit: February 02, 2012, 09:45:38 pm by Theforeshadower »
Logged
  • Super Fan Gamers!
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.036 seconds with 53 queries.