Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 23 Jan 2009
Offline Last Active Feb 23 2015 09:14 AM

#5198937 Serializing individual entities

Posted by 3DModelerMan on 18 December 2014 - 08:13 AM

Okay. So basically just creating component templates using structures and allocating them individually. For the amount of things I'll actually be spawning that way that actually sounds pretty good. I think the only real big loading costs are going to be the things that are placed on levels at the start anyways. I'll be having probably 9v9 player counts at most, so spawning 18 prefabs like that, plus whenever I have to spawn some sort of rocket or other slow moving projectile wouldn't be too bad.

#5195353 Improving component system

Posted by 3DModelerMan on 29 November 2014 - 10:54 AM

I'm working on upgrading my component based entity system. Right now I have a hierarchy of Entity objects within a Scene (which is itself just a special Entity). Each Entity has components that implement a Component interface that are basically a collection of callbacks. Components have onAttach, onUpdate, onDetach, etc. callback functions that are called when these events happen. The problem here though, is that I've got a really random memory access pattern by traversing through the hierarchy every frame and calling into each component. What I would like is to have a more linear memory access pattern where all components of the same type are updated together all at once.


I tried making it so my Component classes were just structures of data, and have a System that actually implemented the functionality. The problem with that though is actually tracking components. Should I require that when an Entity is created it will have a pointer to some sort of "SystemManager" that it can notify when Components are attached or detached? And if I do that, then how would I be able to retain support for my features like disabling entities and all their children? I can't just check the owner Entity of the Component to see if it's disabled, because that would throw another random memory access back in, and it would create more work when I have to traverse the hierarchy upward until the root to see if any parents are disabled.


Basically, all I want to do is be able to make my memory accesses more linear to improve cache performance while retaining my features (mainly creating a Scene in memory without setting it as active; and being able to disable an object and all its children). I don't care if I have to separate functionality from components, in fact I'd prefer to do so because of the extra opportunities for parallelism it presents in the future.

#5174587 Additive blending artifacts

Posted by 3DModelerMan on 18 August 2014 - 06:36 PM

Wow... Alright, for other people's future reference, that pattern is what it looks like when you output the wrong type to SV_TARGET. It doesn't give you a warning or anything, it'll compile just fine. It turns out there was a bug in my shader generator that left the 4 off of the return type. Hopefully no one else will spend 5 hours debugging depth buffers now only to find it was a simple return value issue.

#5159329 How is the elongated light beam/tentacle effect achieved?

Posted by 3DModelerMan on 09 June 2014 - 01:59 PM

I would assume they're just a tesselated textured strip of triangles animated with some sort of sin() or cos() function in the vertex shader.

#5158770 Run DirectX 11 stream output without drawing

Posted by 3DModelerMan on 06 June 2014 - 01:51 PM

I've also been considering using a compute shader to do skinning, but for now I'm just going to do stream out because I haven't written a compute framework in my engine yet.

#5155909 Skeleton representation

Posted by 3DModelerMan on 25 May 2014 - 12:07 PM

Okay, so it's basically the same thing as a normal system performance wise then. I don't think the attachments would need to cause an update at runtime if they didn't affect the transform for current frame would they? Or are you talking about how the bone indices are assigned to the matrix array?

#5147649 Fast GUID generator

Posted by 3DModelerMan on 17 April 2014 - 08:47 AM

Thanks for the advice. I'm thinking so far that I'll probably avoid GUIDs. I thought that was how most engines did things, but if it's overkill for realtime I'm not gonna bother. What the IDs will be used most for is querying game objects by their ID. If an prefab file is loaded with internal ID links then I want to retain those links while also being able to reference objects globally. I also want to have the ability to use the IDs to refer to objects across the network. Would it be a good idea to just have the ID generator reserve IDs in blocks and then "patch" local hierarchies of object IDs at load time? So lets say I load a prefab with local IDs starting from one that are only unique local to the prefab. Then I take the root object of that prefab and generate the next global ID for it, and then just increment the local IDs further down the prefab's hierarchy so that they retain their offset from the prefab root. Are there any inherent problems with a method like that?

#5086616 AngelScript 2.27.1 is here (so soon? yes)

Posted by 3DModelerMan on 16 August 2013 - 05:16 PM

I'm actually really excited to hear anything about a reduced memory footprint. AngelScript is already so small and optimized that it's amazing you can squeeze any more performance out for the features we get.

#5015556 How many levels is enough?

Posted by 3DModelerMan on 29 December 2012 - 04:45 PM

I'm working on a 2D platformer and I'm trying to decide how many levels to have. It's an Android/iOS app. Each level is a little bit less than a minute long but you have to play through them at least three times to find all the unlockables. How many levels make it worth the $0.99 to the players? I want to have lots of levels, but I don't want to have any "filler" content.

#5001829 Impotant! Books to start learning video game programming ! I need it...

Posted by 3DModelerMan on 17 November 2012 - 02:12 PM

I started learning when I was about 12. And the most important thing to remember is that you are NOT going to make a Halo or a Call of Duty or a World of Warcraft for your first game. Too many people (myself included at that time) bite off way more than they can chew and end up giving up on their project. My favorite book for C++ as a beginner was Beginning C++ Through Game Programming by Michael Dawson (that's for the latest edition anyway). I also think that if you aren't ready to learn C++ you might want to try Unity 3D for a little bit to get used to scripting before going for full on programming. If you want to see a Unity project I've finished a game using it and could show you how everything works. PM me if you're interested.

#4993138 Favorite little known or underused C++ features

Posted by 3DModelerMan on 23 October 2012 - 10:45 AM

Personally I like dropping the comma operator into functions just to upset people who have to read my code.

You are Evil Steve Posted Image

#4980684 Making smart-seeming NPCs

Posted by 3DModelerMan on 16 September 2012 - 12:33 PM

This article had really good information. It's applied to open world NPCs but I don't see why you couldn't learn from it for other genres.

#4959339 (C++ Beginner) I hate to post here, but... why won't my "if" stat...

Posted by 3DModelerMan on 15 July 2012 - 01:52 PM

The || && and ! operators operate on entire logical expressions. username == "Tiffany" is an entire expression, but "tiffany" is just a string literal.I made that mistake too when I first started out.

#4945567 birds eye view game

Posted by 3DModelerMan on 02 June 2012 - 07:18 AM

How about a tower defense game?

#4945054 Compiling with NDK without stuffing C++ code in JNI folder?

Posted by 3DModelerMan on 31 May 2012 - 12:25 PM

Thanks. I think it's working now.