I am currently developing a C# .net XNA game engine.
I had a question about the design of the engine. First of all I would like to have my engine be able to incorporate my own scripting language. To do so I was thinking I would have to be able to access to all the properties of all the objects in the game, or just the ones I would like to change.
The first thing I started doing is trying to be able to access by strings. To do so I made every "Entity", something that can be drawn to the screen, have a dictionary of all the properties in it. The adding of the properties was done manually in the Entity class. I have since read that when you have a lot of dictionaries but not very many things in them it can slow down the GC. Which I believe is what's happening in my game right now. I can only get up to about 1000 Entities with basic properties, i.e. Color, Position, Texture, before it starts to lose fps.
I was wondering if there is any other way to be able to access an object's properties dynamically on the fly other than what I'm doing or using reflection, because that is even slower than the dictionaries. Or should I just rethink the entire design?