[SharpDX.Toolkit] How to store game assets

Started by
6 comments, last by Xanather 11 years ago

I'm new to game development (although not new to programming) and i'm trying to learn.

Currently, I'm using the SharpDX.Toolkit API with C# to make a simple test 2D game, but a question arrived as i was writing code to load sprite sheets:

How do i store my content/game assets on the disk?

Currently, i've a folder in my project where i place the assets for loading but, as i was setting the build action on the test sprite sheet, i realized that this might not be the way to do it on a game if i wan't to release it.

Although i'm not concerned with users swapping sprite sheets or using them somewhere else, maybe there's some other problem in doing it ike so?

What's the best way to store the game assets if you're using a content manager like the one SharpDX provides?

Advertisement

I would just place the content files in a seperate folder in the Project, prefarably under the name of "Content". You then selected all the content that you place in there and choose "Copy if newer".

Everytime you compile the project the content is copied to the debug/release directory accordingly.

That's exactly how i'm doing it, but my sprite sheets are plain png files and i've never seen any game exposing those files, so i thought i was doing something wrongh, it's good to know that's not bad, thanks!

Well yeah that shouldnt be a problem, unless you dont want users to look through files that easy. Most of the time though the raw assets end up being extracted from compiled files.

I use XNA/MonoGame which uses .xnb files, which can be decompiled.

I used XNA, but as it's losing support, i decided to move to a new framework, after taking a look at MonoGame, I decided to go with SharpDX. it wasn't a logical decision, I just felt it was the best to do...

about the xnb files, they are the reason i asked the question, i've no clue if they're used for speeding up loading time or just to hide the assets...

what i'll end up doing for the final game is to set the assets as embedded resources in another assembly and load from there, does that sound reasonable?

XNB's do infact speed up the loading time, think of it as being converted to a raw read-ready file that can be sent straight into memory. I don't think it will matter with what your doing with SharpDX anyway.

MonoGame is good, and they are actually breaking away from the XNA framework now and adding new things like RenderTarget3D and multiple window support. I recommend taking a look at it :)

I hope MonoGame further separates itself from XNA and does things like making the content pipeline optional and the various classes instantiatable outside of it (spritefont, effects, etc). I can never get the content pipeline to work properly with Monogame.

Yeah, last I heard the next release of MonoGame will have a alpha content pipeline with it. Also the existing WinGL release can actually load PNG's and such.

This topic is closed to new replies.

Advertisement