• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

beebs1

Members
  • Content count

    656
  • Joined

  • Last visited

Community Reputation

398 Neutral

About beebs1

  • Rank
    Advanced Member

Personal Information

  1. Thanks for the replies!     Yep - that seems to be what they're doing. I can't tell whether they use a C++ object internally or it really is implemented in C. I guess they could have done this for compatibility reasons. They actually define the C++ factory function to call the C function below. Although FMOD_SYSTEM is an incomplete struct type. inline FMOD_RESULT System_Create(System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }   I have the public SDK, which doesn't include the source code.   Is there any advantage to implementing a library like this using a C API, and then adding non-virtual C++ wrappers? I can't imagine many people want to use the C API, although I could be wrong. Possibly performance?   Thanks!
  2. Hiya   I've recently taken a look at the FMOD API and I've noticed that it appears to be a C API, with a really thin C++ wrapper. I'm interested in understanding how they've implemented it.   The C++ classes in the header have no virtual methods or destructor, so they're not inheriting from these classes. Which makes me think that a member function like the following is implemented by just calling the equivalent C function: FMOD_RESULT System::createSound(...) { return FMOD_System_CreateSound(this, ...); } That C function takes a pointer to an FMOD_SYSTEM, which is declared like this: typedef struct FMOD_SYSTEM FMOD_SYSTEM; Which makes no sense to me. What does typedef'ing like this do, when FMOD_SYSTEM is undeclared? And how can the C function take an FMOD_SYSTEM parameter, but they must be passing a pointer to an FMOD::System class?   Many thanks!
  3. Exactly what I was looking for, thanks very much!
  4. Thanks for the quick reply!   Just to clarify - are depth/stencil buffers shared in any way in EDRAM? For example, if I create a second render target with a depth/stencil attached, is this depth buffer a separate area of memory or is it shared with the backbuffer's depth?   I'm trying to avoid tiling so it would be useful to know how much EDRAM I'm using.   Thanks again.
  5. Hiya I've just switched to XNA, and I had a couple of questions I was hoping someone can help with :) Could anyone explain the relationship between eDRAM and render targets on the Xbox 360? Each render target must have some VRAM assigned for the texture data. When you bind a render target with DiscardContents, this texture isn't copied into eDRAM (since this would be slow?) but the texture data is cleared to purple to show this. I guess PreserveContents would cause the texture to be copied, although this would probably be very slow. Is this correct? At what point is the render target in eDRAM copied back to the texture store in VRAM? Also, could anyone tell me how depth/stencil buffers are handled on the 360? If I create a render target with a depth buffer attached, where does the buffer live? Does it have a backing store in VRAM? Thanks for any help! Cheers Jim
  6. Hiya, I recently read about Test Driven Development, and I thought I'd give it a try. I've had some trouble finding meaningful test examples, and I was hoping someone could point me in the right direction with two simple interfaces from my current project. // This interface is used to convert string identifiers to faster string IDs. typedef unsigned int StringId; StringId hashString(const std::string& str); I should probably create two tests for this using known string IDs - perhaps one for an empty string, and one non-zero length known value? // This interface is used to load game assets asynchronously. class AssetLoadJob; class AssetLoadThread : private boost::noncopyable { public: void submitJob(AssetLoadJob *loadJob); }; I'm not sure about this one. It might be an idea to use three tests - a valid job, an invalid job and a null pointer (which should trigger an assertion)? Hopefully if I can get the feel for it using simpler interfaces, I'll have a chance of writing decent tests for the more complex ones. I know it takes enough time to write _your own_ tests, so any insight here would really be appreciated :) Many thanks.
  7. Hiya, I'm using a package file format to group assets together on disk, and I've been thinking about how to organize the various packages. I've come up with two ways of doing this, and I was hoping someone can suggest one over the other. The first is to divide assets into actor packages and level packages. The assets for each actor can be compiled into separate packages, as they generally need to be loaded together. Each level (which references the actors it needs) can then also be put into it's own package, along with any 'per-level' assets (skyboxes come to mind). Shader programs are shared widely between actors (and even the GUI) and would probably needs to be bundled in their own package. [CODE] Game.exe Shaders.pkg /Actors Actor1.pkg Actor2.pkg /Levels Level1.pkg Level2.pkg [/CODE] The second is to divide assets into packages by type, e.g. Textures.pkg and Shaders.pkg. I could then use the game logs to (automatically) re-order the package contents in the order they will be loaded. A problem here might be that the game doesn't load in this way, by batches according to the asset type. [CODE] Game.exe /Data Textures.pkg Shaders.pkg Materials.pkg [/CODE] Any thoughts would be greatly appreciated! Cheers.
  8. There was a thread about this recently. The general wisdom seems to be that you should only use multiple threads if your game has been programmed sensibly, but still can't achieve interactive frame rates on a single thread. Often the APIs you're using will use multiple threads internally, such as the FMOD sound system. There's no need to do it yourself. If disk I/O is a problem, it's easier to use the asynchronous I/O provided by the operating system rather than multiple threads. If data processing is the bottleneck, it's probably better to process your data files offline and have the game read simpler binary structures from disk. Hope that helps. [Edit] The earlier thread (no pun intended) is [url="http://www.gamedev.net/topic/627258-how-many-average-number-of-threads-does-a-game-needs-regardless-of-simplicity/"]here[/url].
  9. Ah thanks, that's a good idea. I'll go for that. To add to this - I might try out a slightly different idea along with that. My assets currently have a 'state' enum specifying whether they are loaded, pending, or encountered an error. This implies, although I hadn't previously realised, that it is valid for an asset to exist in the cache without being loaded - there are no null pointers, just empty handles. So I can begin by loading up all the assets in bulk, in the correct order. When a material is loaded it can kick off jobs to load any missing shader and texture dependencies if needed, get back the 'pending' handles, and then forget about them. There's only a small handful of code which actually cares whether an asset is loaded or not - so I can manually check there, which will only be the cost of testing the state enum. If the asset isn't loaded I can ignore the operation and/or return null, false or whatever - and log the problem. I can imagine this being very useful - for example, if you start the game with a vertex shader file missing, the objects using that shader just won't draw because the asset will be marked with an error state. This would also be useful with asset swapping at runtime. If an asset change is picked up but fails to load, the objects just stop being drawn or the sound stops playing, and a warning is written to the log. Thanks for all your help. I'll try down this path for a while and see what happens Cheers!
  10. Thanks for the replies [quote name='bronxbomber92' timestamp='1345693356' post='4972469'] ... [/quote] Yep, that seems sensible. I'll try and base the design around this. [quote name='Hodgman' timestamp='1345698011' post='4972483'] (example) [/quote] Thanks Hodgman. The only part I'm missing is that without parsing a material, for example, I can't tell what shaders it references. So I guess the parse() method will need to be able to back out and say "I'm missing these dependencies". It could then be pushed to the back of the batch, after the dependencies it needs. Cheers.
  11. Hiya, I posted a question about asynchronous resource loading previously, and got some really useful replies. I've run into a problem with resource dependencies, and I was hoping to see what others think. My original system had several resource types, and some were dependent on others - for example, a Shader resource is dependent on a VertexShader and FragmentShader, and a Material is dependent on a Shader. I solved this by providing the loaders access to caches of the dependent resources, which works fine when everything is synchronous: [code] ResourceLoader<Shader> shaderLoader; ResourceCache<Shader> shaderCache(&shaderLoader); // Allow the material loader to resolve shader references: ResourceLoader<Material> materialLoader(&shaderCache); // Now a material request will automatically load the shader if necessary. ResourceCache<Material> materialCache(&materialLoader); MaterialPtr material = materialCache.get("test.mat"); [/code] With asynchronous loading this isn't so straightforward. A material will be loaded and asynchronously load its dependent shader, but the shader won't be loaded right away and might even encounter an error - making the material invalid. I could design some complicated dependency system, but I'm hoping there is a simpler way. Does anyone have any suggestions to point me in the right direction? Many thanks!
  12. Thanks everyone, this is great advice [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I've almost got the basic async loader working, but I've run into a problem. Some of my resources have dependencies on others, such as a material being dependent on a shader program. In my original system I was handling these dependencies like so: [code] IResourceLocator* locator = new ArchiveResourceLocator("resources.zip"); ResourceLoader<Shader> shaderLoader = new ResourceLoader<Shader>(locator); ResourceCache<Shader> shaderCache = new ResourceCache<Shader>(&shaderLoader); // The material loader needs to be able to resolve shader references... ResourceLoader<Material> materialLoader = new ResourceLoader<Material>(locator, &shaderCache); ResourceCache<Material> materialCache = new ResourceCache<Material>(&materialLoader); // A request for a material will now 'automagically' use the shader cache... [/code] This is a problematic when the resources are loaded asynchronously, as a request for a material also has to wait for the shader dependency to be loaded. When an asynchronous read has completed and the resource is ready to be 'loaded' for real, I will need to check whether it's dependencies are fully loaded before proceeding. I can see this "resources waiting for resources" turning into a big mess quite easily. I don't think I have any other choice, but I was hoping to see what others think before I go for it. Thanks again
  13. OK - I've made a couple of changes to make my resource system work with asynchronous loading: [img]http://jamesbb.co.uk/ResourcesNew.png[/img] Instead of the cache returning [font=courier new,courier,monospace]T*[/font] it can now return a [font=courier new,courier,monospace]ResourceHandle<T>*[/font], which tracks whether the resource is loaded or not. The cache owns a map of these handles. When a resource is requested and the cache doesn't have it, it calls [font=courier new,courier,monospace]ResourceLoader<T>::preLoad()[/font]. This can issue the asynchronous read and return a 'not loaded' handle, which is stored by the cache in a separate pending list and returned to the client immediately. When [font=courier new,courier,monospace]ResourceCache<T>::update()[/font] is called (once per frame), it checks the list to see which asynchronous reads have completed, and calls [font=courier new,courier,monospace]ResourceLoader<T>::postLoad()[/font] for those. That's where the GPU objects are created, for example. The resource is removed from the pending list, and it's flag is set to loaded. So the overall flow will be something like this: [code] LoadLevel Request all resource from the cache, which returns the handles. While any resources are still being loaded: Loop, draw the loading screen and call ResourceCache::update(). [/code] I think that should work. Seems reasonable?
  14. Thanks, very useful information. [quote name='Hodgman' timestamp='1344944891' post='4969410'] 2) [i]The build system[/i]. Just like you do for your code, you create a type of "makefile" for your assets, often for a custom built build-system, but possibly also for an off-the-shelf one ([i]e.g. XNA uses msbuild[/i]). Whenever you've updated some assets ([i]e.g. saved/edited them, or updated SVN, etc[/i]) you run your build-script, which uses timestamps/hashes etc to only recompile the necessary files. The game doesn't contain any parsing/compilation code (just simple binary loading code); all the parsing/compilation code is pulled out into separate tools that are used by the build system.If you want to support modding, you can also ship the build system. [/quote] This seems very straightforward, and it will almost certainly make disk IO the loading bottleneck - which I can handle with overlapped reads. [quote name='Hodgman' timestamp='1344944891' post='4969410'] 3) [i]The persistent build system[/i]. As above, but the build system sits in your system tray all day and watches your source asset directory. Whenever you change a file, it automatically recompiles it in the background. If the game is running, then when it's complete, it sends the game a message telling it to reload the modified file. [/quote] This seems very fancy [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img] Is there a preferred way of the directory watcher communicating with the game? My first thoughts would be some kind of shared Win32 event, or a named pipe. Or perhaps the game listening locally on UDP? Thanks again.
  15. Thanks for the replies! [quote name='ajm113' timestamp='1344887008' post='4969176'] Example Method... [/quote] Interesting stuff, but I'm not sure I need that level of functionality/complexity right now. My levels are completely discreet - one gets loaded, unloaded, on to the next level. It's really just a load-time problem currently. Thanks for the tip about the priorities! [quote name='dimitri.adamou' timestamp='1344894131' post='4969204'] So when you go to your load screen, think of it like this [code] Game Loop While more data to load (Read from Queue or something like that) Load Data for 50ms Render Loading Page Progress [/code] [/quote] Thanks - I think that could work well. Instead of loading synchronously all in one go, I could trickle through a small number of resources each frame until everything is good to go. I need to keep a screen element animated while loading and I'm not sure how much I can do in the main thread, so I'll measure it and see for sure. Nice idea. I'm not too worried about locking, but threading always seems difficult to debug and profile for me. Cheers!