dechorus

Members
  • Content count

    35
  • Joined

  • Last visited

Community Reputation

120 Neutral

About dechorus

  • Rank
    Member
  1.   That's exactly what XNA's ContentManager does.   Texture2D texture = Content.Load<Texture2D>("nameOfTexture"); SpriteFont font = Content.Load<SpriteFont>("nameOfFont");   Why not just use that?   The ContentManager is used to Load objects, not get them once they've been loaded. I don't think I'd be creating new variables for each and every texture and so on. A Dictionary seems more appropriate.   As for the generic solution I was after, I've come up with this:   Dictionary<Type, object> dict; public void Add<T>(string key, T value) { Type type = typeof(T); bool dictContainsKey = dict.ContainsKey(type); if (!dictContainsKey) dict.Add(type, new Dictionary<string, T>()); Dictionary<string, T> nestedDict = dict[type] as Dictionary<string, T>; if (nestedDict.ContainsKey(key)) nestedDict[key] = value; else nestedDict.Add(key, value); } public T Get<T>(string key) { Type type = typeof(T); bool dictContainsKey = dict.ContainsKey(type); if (!dictContainsKey) return default(T); Dictionary<string, T> nestedDict = dict[type] as Dictionary<string, T>; if (nestedDict.ContainsKey(key)) return nestedDict[key]; else return default(T); } What are your thoughts - is this a bad / unnecessary implementation?   Admittedly it's a little messy, and probably unnecessary. For whatever reason I felt a single Dictionary with all assets is the way to go. My plan was to then write getters and setters and so on for accessing specific types, such as GetTexture(string key) { return // ... gets Texture2D from nested dictionary in dict }   Anyway, I guess having Dictionaries for each type seems to be a more suitable and cleaner solution.   Thanks everybody for your input.
  2. My initial implementation is in fact having multiple dictionaries for each type, which is absolutely fine.   I suppose the reason I wanted it this way was so that the class could be generic enough to be used across projects.   If I required a dictionary of objects using a class that was specific to a particular game, such as a Level class, then the list would be generic enough for me to Add and Get levels, as opposed to adding a new dictionary for Levels which would be specific to a game project.   Does that make sense?    Thank you for your response!
  3. Hey guys. I'm working in XNA.   I'm basically trying to have a Data/Asset Manager class that holds everything that's loaded in by the ContentManager.   I'm trying to have a property that's essentially something along the lines of     Dictionary<T, Dictionary<string, T>> listOfObjects;     My hope is to be able to get objects doing something like     Texture2D texture = listOfObjects<Texture2D>("nameOfTexture"); SpriteFont font = listOfObjects<SpriteFont>("nameOfFont"); // etc.      Any help and / or suggestions? Thank you so much in advance
  4. Hey everyone,   So I have an XNA 4.0 windows game in VS2010 running on my Windows PC (windows 7).   The game itself isn't finished yet, but before I continue work on it I'd like to try to get it running on my iPad, so that I suss out the porting procedure and feel confident about continuing to use XNA. The primary platforms I'd like this game to go on would be on Windows (and possibly Mac) and iOS.   I know that monogame is the way to go with porting XNA to iOS, but I'm finding it difficult finding step by step walkthroughs as to how to actually do this.   This is what I currently have:     A windows 7 PC Visual Studio 2010 My XNA 4.0 game project on windows 7   A Macbook MonoDevelop (it was installed as part of the Unity 4.0 install) An iOS developer account Latest XCode   Can anyone point me to any tutorials or guides as to how I can, from here, get my game ported over to iOS? Any comprehensive help and tips along with them would be much appreciated.   Thanks so much.
  5. Greetings, The gist of it: I'm making an adventure game in C#, and I've just started a development blog: [url="http://decorus-carcer.blogspot.co.nz/"]http://decorus-carcer.blogspot.co.nz/[/url] I'm a fairly junior developer who's been working on an old school 2D point and click graphic adventure game for some time now. I'm coding it entirely by myself in C# using XNA. I have made significant progress since I first undertook this fairly insane quest, bypassing opportunities to start out with tetris and mario clones while gunning straight for the big old graphic adventure. I've admittedly run into frequent road blocks regarding simple things like storing data (conversations, locations, etc) and saving the game. I've since overcome these issues, but of course with new nagging ones instantly taking their place. I hope to document my progress as I continue developing the game. For those experienced devs out there, I'd really appreciate if you could follow my blog and my progress. It is a means for me to share my progress alongside any discoveries I make, but I also hope for it to be a forum of sorts for discussing techniques I've used, and the inevitable problems I come across. God knows I've far too often tried pulling my hair out as I hit problem after problem after problem - so I could really benefit from as many readers as possible. As I continue to make progress on the game engine and iron out technical issues, I will disclose more information regarding the story and concept. As for now, all I can say is that the theme of the game is "beauty", and that there is a teaser video on the blog that partially gives away the look and feel the game will have. Thank you to all who decide to check it out.
  6. [quote name='Ryman' timestamp='1328057741' post='4908225'] If you strip the combat out of Planescape then it would've become an Adventure Game. Which it could be argued that it would've been more appealing to a wider audience. However, Planescape did flop big-time when it was released, and one of the reasons could've been that the combat system (even though at the time, most RPGs had the same or very close combat system) was very bad. [/quote] Absolutely - it would have been an adventure game. And that's what everybody loves about the game; it's in-depth and ridiculously well written story. In other words, the adventuring portion (the greater portion). [quote] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left]I don't understand the love for Adventure Games (point-and-click ones), because everytime I try to make one it feels like I've stripped everything out of an actual video game and instead created a cartoon show. It's very unmotivating... [/left][/size][/font][/color] [/quote] It's true with linear adventure games. You're just moving from one node to the next, solving arbitrary inventory puzzles. I dislike most that are structured this way. The beauty of PS:T is it's non-linearity, and the stupendous amount of choice players have. The game often intellectually challenges in regards to knowing where to go, what people to go talk to, what places to look, who to probe for information, and what choices to make to turn a conversation to your favor. With games such as this, the interactivity is *pivotal* to the experience. With those that say that role playing games, or games in general *require* combat in order for it to *work* are severely limiting themselves with such narrow-mindedness. There are so many different ways games can offer challenges, or breathtaking experiences. It is by far not limited to combat. The amount of combat in PS:T is still relatively very small, but yet it still *feels* padded out, only because of the clunky D&D mechanics, and in turn, feels less enjoyable. A different approach would likely have kept the level of immersion more consistent throughout the game. That is all I'm really saying.
  7. [quote name='Paul Franzen' timestamp='1323890166' post='4893940'] There are certainly examples of RPG-style games without any combat--[i]To the Moon [/i]being the most recent one, but also [i]A Light's End [/i]on XBLIG, and...and... OK, maybe there's not a lot of them, but it happens, sometimes. And it's awesome for players like me, who fit exactly into the mold you're talking about--I tend to play games because I want to get immersed in a story where it feels like I'm the star and I'm the director, not necessarily because I want to hit things with a sword. Not that I think combat is inherently bad--for me, personally, it just tends to be filler that gets in the way of what I'm most interested in. [/quote] You describe me exactly. It's not that combat itself is bad - and again, with our example here, I'm not saying that the narrative should have been altered not to include fighting. I'm just saying that sometimes, games like Heavy Rain - a game entirely focused on its story, and the way it tells it - doesn't need to have a combat engine like Tekken or Virtua Fighter, or give the player full FPS controls for segments involving shooting. The game Dreamfall: The Longest Journey suffered from using such contrived combat mechanics, and in my opinion alongside *many* others, so does Planescape: Torment. Heavy Rain is an 8ish hour long adventure game. Imagine that length being padded out because of a complicated fighting engine with a steep learning curve. The player would be forced to master the mechanics well enough to progress through one or two tough battles that are setting them back, when all they really want is to save the damn kid and see how the mystery unfolds. My argument isn't against combat, or D&D. I'm simply exploring the idea: would Planescape: Torment have been more *immersive* if it were stripped of its D&D mechanics? What are the alternatives? What alternatives do you think would have worked? Thanks for everybody's input so far.
  8. Heya, I was wondering about the proper implementation of parents/children in a sprite class, beyond the usual members of a sprite class, such as Position, Texture2D, Rotation, and etc. What I was personally planning on doing was to simply add two new members: Sprite Parent; List<Sprite> Children And then of course, change all the members to look more like this (Alpha member example): get { if (Parent != null) return Parent.Alpha * this.alpha; else return this.alpha; } At first I thought this wasn't such a bad idea (how else would such a class be implemented/structured?) but with this example in particular (alpha), drawing a Sprite where, say, alpha = 0.5, and which has many children, will result in each child Sprite blending into each other, since all of their alpha values are now at 50% The desired result is that the object as a whole would be at 50% transparency and blends only with the background, and not with Objects that are within itself. I thought of each parent Sprite object to be drawn to a Texture2D using a render target, and then applying the alpha to the Texture2D instead. That way, the object as a whole would have a transparency of 50% and not every child Sprite. But to have each Sprite applied to a Texture2D using a render target... would such a thing not be very taxing on the cpu? My question then is... what is the best implementation of a Sprite class that has this functionality? It really is basically trying to replicate the MovieClip class in AS3. How could this be replicated in C#/XNA? Thanks. Any help/input would be appreciated.
  9. [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left]Hello,[/left][/size][/font][/color] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left]I've searched and searched the net for serializer classes that do as the topic describes, but have found none. Is anybody out there using a serializer class that can take care of everything for them? The best I got -- I have to specify an array of all other custom classes that the object I'm trying to serialize contains, and even then, it cannot serialize dictionaries, since they're not supported. Using this class also doesn't serialize private objects, for obvious reasons, but I'd like to know if there is a way to serialize them using a helper class.[/left][/size][/font][/color] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left]How do you handle your XML Serialization?[/left][/size][/font][/color] [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left]Is having a single class to take care of everything possible? If anybody can point to some classes I could download or code online, that would be great. Your personal solutions would also be appreciated. [/left][/size][/font][/color]
  10. This probably belongs in the General Programming section - I've made this post in there instead. This thread can be removed.
  11. Hello, I've searched and searched the net for serializer classes that do as the topic describes, but have found none. Is anybody out there using a serializer class that can take care of everything for them? The best I got -- I have to specify an array of all other custom classes that the object I'm trying to serialize contains, and even then, it cannot serialize dictionaries, since they're not supported. Using this class also doesn't serialize private objects, for obvious reasons, but I'd like to know if there is a way to serialize them using a helper class. How do you handle your XML Serialization? Is having a single class to take care of everything possible? If anybody can point to some classes I could download or code online, that would be great. Your personal solutions would also be appreciated.
  12. [quote name='BLiTZWiNG' timestamp='1323403337' post='4892066'] [quote name='dechorus' timestamp='1323401363' post='4892059'] [quote name='Ashaman73' timestamp='1323076834' post='4890643'] Isn't the problem, that when you strip the RPG part from PS:T you are left with an interactive story/movie ? It's like taking away the golf ball from a golf tournament to get a better view of the landscape. Yes, it is a lovely landscape, but it is no longer a game. A good story can be very important for a game, but you should always start with a good gameplay first instead of bending the gameplay to the story (IMHO this is one reason movie/book adaption are poor rather than good). [/quote] Going with that golf analogy - suppose one wishes to see some amazing sights, but are held back because they have to play (and win) a game of golf, and until they do, they cannot see what they came for. Golf is fun in its own right, but you may find yourself spending more time than you'd like on it all because you'd like to see some landscapes. [quote name='LorenzoGatti' timestamp='1323081420' post='4890657'] This is simply your taste, and it is definitely misaligned with Planescape taste: you dislike the closely tied tactical combat optimization and strategical power accumulation that are the true soul of AD&D. Imagine a RPG character whose best plan to win fights is "yuck". Can you honestly imagine such a character not dying ignominiously as soon as he has an adventure in a dangerous place like Sigil? [/quote] Going by reviews across the web, these are not just my views. Plenty of people found the actual combat and interface to be frustrating and obtrusive, and interfering with what they enjoyed most about the game: the story. And more importantly, the experience. Meeting new people, discovering new places, finding new truths, solving mysteries... and the like. I realize that my views seem to contradict the idea of 'playing a game'. A story without any roleplaying could be found in a book or a film, and I realize that these should be the alternatives I ought to go for if I cannot simply handle the 'game' aspect of these games. But that is not true at all - and Planescape: Torment is the perfect example I can use, for it simply cannot EXIST as a book or a film. What makes the experience so enthralling is the interactive element. YOU are the Nameless One, and you need to find out what's going on. You make moral choices. You can explore the locations and get to know its citizens. You are in control of solving the mystery behind your past. But the problem is it exists as a 'game' when it really ought to exist as an 'interactive experience'. I think that is, in a sentence, how I would summarize what I think of it. [/quote] You're kind of arguing against your own point here. You have to make choices and solve problems, but what if making choices and solving problems is stopping you from enjoying the story? You solve puzzles in Myst, but it's certainly not easy. There is no AD&D there. [/quote] The learning curve for an adventure game is significantly lower than that of a D&D RPG. Compare the playing manuals of each type of game, and you'll find the latter to consist of hundreds of pages. In any case, I'd rather not consider this thread as an argument of A vs B, but rather to simply explore B as an alternative to A. CAN a game like PS: T be just as amazing (perhaps even more so?) if the gameplay was that of a different genre entirely?
  13. [quote name='Ashaman73' timestamp='1323076834' post='4890643'] Isn't the problem, that when you strip the RPG part from PS:T you are left with an interactive story/movie ? It's like taking away the golf ball from a golf tournament to get a better view of the landscape. Yes, it is a lovely landscape, but it is no longer a game. A good story can be very important for a game, but you should always start with a good gameplay first instead of bending the gameplay to the story (IMHO this is one reason movie/book adaption are poor rather than good). [/quote] Going with that golf analogy - suppose one wishes to see some amazing sights, but are held back because they have to play (and win) a game of golf, and until they do, they cannot see what they came for. Golf is fun in its own right, but you may find yourself spending more time than you'd like on it all because you'd like to see some landscapes. [quote name='LorenzoGatti' timestamp='1323081420' post='4890657'] This is simply your taste, and it is definitely misaligned with Planescape taste: you dislike the closely tied tactical combat optimization and strategical power accumulation that are the true soul of AD&D. Imagine a RPG character whose best plan to win fights is "yuck". Can you honestly imagine such a character not dying ignominiously as soon as he has an adventure in a dangerous place like Sigil? [/quote] Going by reviews across the web, these are not just my views. Plenty of people found the actual combat and interface to be frustrating and obtrusive, and interfering with what they enjoyed most about the game: the story. And more importantly, the experience. Meeting new people, discovering new places, finding new truths, solving mysteries... and the like. I realize that my views seem to contradict the idea of 'playing a game'. A story without any roleplaying could be found in a book or a film, and I realize that these should be the alternatives I ought to go for if I cannot simply handle the 'game' aspect of these games. But that is not true at all - and Planescape: Torment is the perfect example I can use, for it simply cannot EXIST as a book or a film. What makes the experience so enthralling is the interactive element. YOU are the Nameless One, and you need to find out what's going on. You make moral choices. You can explore the locations and get to know its citizens. You are in control of solving the mystery behind your past. But the problem is it exists as a 'game' when it really ought to exist as an 'interactive experience'. I think that is, in a sentence, how I would summarize what I think of it.
  14. Well, sure. To a certain degree, adventure and roleplaying games that take choice into account do pretty much the same thing. Though they offer visuals and sound, the gameplay more or less comes down to making those choices. I know that's not the case with most games, but if you strip them down, that's more or less what you end up with. And to a lot of us, that is one of the most compelling parts of those games. How can we expand this kind of gameplay - is my question, really. Slapping a roleplaying game on top of it expands the gameplay significantly, yes, but it doesn't really improve it. Planescape: Torment being Exhibit A.
  15. Planescape: Torment was a phenomenal game. Its greatest criticism however, was the clunky combat mechanics - while its greatest strength was its adventure game-like story telling and attention to detail. The point of this topic is to explore the idea of a game like PS: T, minus all of the contrived role playing mechanics. The game is enjoyed most when cutting through its thick plot and dialog, and least enjoyed when weapons are drawn. Most of the game can be played like an adventure game, but at certain points combat is inevitable, and it makes all those stats and all those items you've ignored in favor of the plot come to bite you in the backside. Inventory management, spellbooks, statistics, THAC0... yuck. Would a game like this have been improved if it weren't a D&D role playing game? Is it possible to have a legitimate 'game' out of simple exploration and conversation? Of course, it would more or less turn into an adventure game, but what is it about experiencing a story in a video game and allowing player input that makes it superior to a experiencing a story in a book or film for example? Player input means player choices means branching storylines - but in terms of gameplay all that really translates to is pointing the cursor to your desired answer to a multi-choice question. How can we turn a story experience into an "interactive experience", truly, and how can it be better by being one rather than not? I know I'm really exploring two (almost) separate ideas here, but I feel they go hand in hand, as one came about from the other. In any case, share your views about either one!