Jump to content
  • Advertisement
Sign in to follow this  
Mito

[SharpDX.Toolkit] How to store game assets

This topic is 2289 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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.

Edited by Xanather

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!