Hello everyone,
Currently I'm developing a small project, a game and it is almost done, but now, I would like to restructure it, develop an appropriate style of programming in game dev. industry.
I'd like to improve my knowledge in concurrency, multi-threading and networking, so these are the plans for the [near] future. As of now, I would like to ask for your help and advise.
How should I structure and handle my assets?
Here is my current code that loads certain elements :
My next idea was to scan appropriate folders and automatically load assets in respective order.
I was given an advice to use content pipe-lining, regular expressions, something like this
and encode in the config file. I didn't quite get it. Any one can explain this a bit more details, pls?
Also, I found some related material online, the XML structure had been mentioned, but I am a bit lost about that.
Thanks in advance.
Currently I'm developing a small project, a game and it is almost done, but now, I would like to restructure it, develop an appropriate style of programming in game dev. industry.
I'd like to improve my knowledge in concurrency, multi-threading and networking, so these are the plans for the [near] future. As of now, I would like to ask for your help and advise.
How should I structure and handle my assets?
Here is my current code that loads certain elements :
Code:
#region constants for Explosion const string _path_Expl_0 = _path_Explosion + "0/"; const string _path_Expl_1 = _path_Explosion + "1/"; const string _path_Expl_2 = _path_Explosion + "2/"; const string _baseName_Expl_0 = _path_Expl_0 + "DES_"; const string _baseName_Expl_1 = _path_Expl_1 + "ExplC_"; const string _baseName_Expl_2 = _path_Expl_2 + "Bomb_"; #endregion private void LoadExplosion() { //asteroid explosion for (int i = 0; i < _numOfAsteroids; i++) { _gameObject.Space.Asteroid.Multiple[i].Explosion = new GameEntity(LoadTexture2D(_path_Expl_1, _baseName_Expl_1, "00", "0")); } //main ship explosion _gameObject.Ship.Single.Explosion = new GameEntity(LoadTexture2D(_path_Expl_2, _baseName_Expl_2, "00", "0")); //enemy ship explosion for (int i = 0; i < _numOfEnemies; i++) { _gameObject.Enemy.Multiple[i].Explosion = new GameEntity(LoadTexture2D(_path_Expl_0, _baseName_Expl_0, "00", "0")); } }
I was given an advice to use content pipe-lining, regular expressions, something like this
Code:
strStarfieldAssets = config.GetStarfieldAssetName(level1); loader.LoadSheet(strStarfieldAssets); StarfieldAssets { Level=1; Count=10; Filename=starfield_*.png; }
Also, I found some related material online, the XML structure had been mentioned, but I am a bit lost about that.
Thanks in advance.
Comment