Tuesday, May 9, 2017

Managing game content can also be CRUD oriented!


what is CRUD?

It was first reference in the article entitle “from semantic to object-oriented data modeling” by Haim Kilov in Conference: Systems Integration, 1990.  But I’m pretty sure CRUD operation was used earlier than 1990. In application development CRUD is an acronym of the four most common operation in database development where the application have the functionality to Create, Read, Update and Delete a record.

CRUD can be used not only in database application, it can also be used in game development where you can Create/Load,  Read/GetData,  Update/Modify and Delete/Remove a content or  game entity at any time anywhere in the code.

Since the time of XNA I’m already not a fond of its content pipeline’s loading and unloading of game assets, not the technology involving in it, the content pipeline processors are good, so don’t get me wrong XNA is a nice piece of game framework after Managed DirectX or MDX. But the framework’s design on how to load and unload of game content are somehow limited or restricted, unless you do some workaround. For a much more flexibility and manageability I believed it should have the ability to Create/Load, Update/Modify, Read and Delete/Remove selected or all content at any giving time, wherever you wish in the code.

MonoGame on the other adopted the loading and unloading scheme found in XNA since  I’m using MonoGame framework on my Game Development Kit I decided to create my own content manager and not using MonoGame Content Pipeline, I’m not saying it’s a bad move or one’s should not use it. But I want more control over the content I will be loading and unloading within the whole life of the game.
What I have implement in Z-GDK is the ability to create, read and remove selected or all content at any given time anywhere in the code as shown in content managers below like texture and mesh content manager :

Content Managers :

Let's take a look at Texture Content Manager :

Let's take a look at Mesh Content Manager :

In Z-GDK Content or Entity managers have a simple properties and methods layout, but have different kinds of overloads; as for example the Remove methods has an overloads to remove item by index,  by auto assigned UID(Unique ID ), by Name or by user defined Scene ID as I will be tackle on the later parts. CRUD operations was also applied in game entity managers as shown below the model entity manager:

Z-GDK sample code on how easy and simple it is to load game content and to create game entity without using content pipeline :

See you on PART 2 : CRUD : Loading and Content Creation

No comments:

Post a Comment