Jump to content
  • Advertisement

????????? ????????

  • Content Count

  • Joined

  • Last visited

Community Reputation

169 Neutral

About ????????? ????????

  • Rank

Personal Information

  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ????????? ????????

    Code Review? Please?

    Since WorldModel keeps vector of UnitModel, it seems to me like the only way to get a list of units in sight of one unit. Or if unit needs to fire a bullet, it's needed to put this bullet in the world. somehow. Just don't know how else do I do that. As far as I know .get() not increasing reference count, that's why I pass raw pointers. Is it a bad practice?
  2. ????????? ????????

    Code Review? Please?

    Thanks for your reply! Should I make it just public? Just felt natural for me. Anyway, can you suggest what approach would you prefer? Yeah, sorry for dumb comments. I thought my code is kinda self-explanatory, so I didn't add much comments. I know that code review is time consuming, so maybe I just asked about it in wrong place? Can you suggest where I should go?
  3. ????????? ????????

    C++ Code Review? Please?

    I'm a C++ newbie, and I heard a lot that the best way to learn how to code is actually code. So I tried. The project is still in progress so please don't be embarrased. At least I think it's tiny enough to be read quickly. Here it is https://github.com/FennecFix/Delirium/tree/master/src It written in C++ with use of Oxygine framework. Please don't mind the commit comments, it wasn't intended to show in public. I really want to aks you to point out any flaws of my code
  4. Hey, guys. I've tried to write my own game countless times. And I finished a very few of them, all because of bad design decisions, which made my code hard to read and even sometimes painful to look at. Even through 5 years of working as developer I'm still struggling to write a nice designed code. I read about design patterns a lot of times, it helped but not as much as I thought it would. Most of tutorials online using bad design practices. So, I want to ask you to suggest an open source plaformer-like/zelda-like game with which design is good in your opinion. I lookd a lot of them by myself but didn't found what would seem good for me.
  5. ????????? ????????

    Building game architecture

    To be honest, it's not my first game, but, all this time, for some reason, I thought that I might have wrong approach to making decisions. And yes, I had a misconception about OOP, I thought it's a lot about building strong hierarchies, where only "high-level" objects can know something about "low-level" objects but not vise versa. So I decided to ask here.   So thanks again, everybody, I got the idea.
  6. ????????? ????????

    Building game architecture

    Thank you guys! You really helped me to decide what to do!
  7. I've trying to figire out how to build relationship between World and Units inside this World. On one hand Unit souldn't know nothing about World, because World is high level object and I don't want to let Unit to call World's methods, but on the other hand Unit should somehow to know which enemy Units it sees. How to build this relationship between them correctly? Should Unit object contain link on World object? Or maybe theres some other workarouds for this?
  8. ????????? ????????

    MVC understanding

    Yes, that's pretty obvious, in case Unit and Weapon represented as single class. But I want to separate logic from rendering.     This approach would lead to total disaster. Unit is not only controllable by player, it could be controlled by computer. And for this case there can be different behaviors, like citizen, guard, fast zombie, jumping zombie etc. I want to just plug in this behaviour to Unit instead of making long if or switch statements   You're right! Thats why I want to break code apart. To make it simpler to read, debug and optimize.
  9. ????????? ????????

    MVC understanding

    okay, lets say I have another project, where I got some kind of Unit, which have health, sight radius, strength etc. I want it to be represented on battle field, on the bottom of the screen (avatar with states), and in info window. I also want it to be controlled by player or computer (mind controll). But that's not all: unit also has a Weapon, which also has some stats, and I want to see it on Unit on battlefield and on different tab in info window. Weapon could use different behaviour: semi-automatic, automatic or melee.   Seems like it need MVC. But how do I implement this hierarchy?
  10. ????????? ????????

    MVC understanding

    Well, that's true, you're right.   Anyway, I would like to know how to put rest things together.      How do I connect them? Am I suppose to put Board and Players Models inside Game Model? If so, how do I attach Views to those Models? Do I need to store GameModel, GameView and GameController in some kind of container class Game? I read a lot about this pattern but can't find some concrete implementations in context of games.
  11. ????????? ????????

    MVC understanding

    But it seems to me, that each entity can be broke apart to Model, View an Controller. I mean each entity has some data to store, some representation to view, and some actions to do. It would be nice to keep those parts of code separetly, so classes could be shorter and clearer to understand. I mean, yeah, MVC for tic-tac-toe is definetly overkill, but it's just to keep things as simple as possible. It would be nice to figure out how this design patter works on something simple.
  12. ????????? ????????

    MVC understanding

    Hey guys. I've some problems with understanding MVC. I mean I know that Model stores data, Controller changes that data according to user input, and when changes happen, Model dispatches event, so View could catch it and render representation. But how do I suppose to arrange all that stuff? Do I need some kind of container class, which contains all in one Model, View and Controller? And most important: how do I build hierarchy with this? I've read about HMVC, but there's no answers too.   For example, I'm trying to make a tic-tac-toe game, and I have Game, which contains two Players, and Board.   Game has it's Model, View and Controller  GameModel contains two Players and Board GameView represents two Players and Board GameController responsible for taking turn.   Player has it's Model, View and Controller  PlayerModel contains state (active/inactive) PlayerView represents Player screen PlayerController implements logic (human/computer)   Board has it's Model, View and Controller  BoardModel contains cells BoardView represent cells BoardController mark cells (X/O)   MVC should help to organize code, but for now it turned my code into complete mess.   I've got my project here https://github.com/FennecFix/tictactoe   It would be so nice, if you help me organize my code correctly
  13. Hey guys.   I have a problem building input architecture.   I use heirarchical MVC, it looks like this: World -> WorldModel -> Unit -> UnitModel -> Weapon -> WeaponModel -> WaponView -> WeaponController -> UnitView -> UnitController -> WorldView -> WorldController I don't know if this right understanding of concept.   My Input class looks like this package com.fennec.delirium.utils { import flash.display.DisplayObject; import flash.events.KeyboardEvent; public class Input { public static const instance:Input = new Input(); private const _keys:Object = {}; private var _owner:DisplayObject = null; public function Input() { if(instance) { throw new Error("use Input.instance!"); } } public function init(owner:DisplayObject):void { _owner = owner; owner.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); owner.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); } private function onKeyDown(event:KeyboardEvent):void { _keys[event.keyCode] = true; } private function onKeyUp(event:KeyboardEvent):void { _keys[event.keyCode] = false; } public function isKeyDown(keyCode:uint):Boolean { return _keys[keyCode]; } public function get mouseX():Number { return _owner.mouseX; } public function get mouseY():Number { return _owner.mouseY; } } } Which doesn't fell right, because I think I may want to add some other input devices, like joystick. But for now it's the best thing I inveted so far.   The problem is that Unit's model position is in world coordinates, and mouse position is in screen coordinates, and I need them both to be from same source, so I could define Unit's face direction.   I want to avoid this singletone implementation for Input. Seems like I just need to make instance Input and pass it to UnitController but here's some troubles: - I need two different owners for Keyboard + Mouse input: one for stage and one for world. This seems to violate incapsulation between responsibility layers. - I need to pass Input from top level, which means WorldModel would know about Unit's Input, which also violates incapsulation.   I'm really stuck and need advice.
  14. ????????? ????????

    Graphics Engine (C++)

    looks helpful, thanks guys!
  15. ????????? ????????

    OpenGL Graphics Engine (C++)

    Hi.   I want to develop some sort of simple 2D graphics engine for my android game (using OpenGL ES 2.0, because I really want to learn about shaders). So I've managed how to process OS events, and how to draw a triangle. But where do I go next? Is there some articles or book that could guide me through? I can't say that I have absolutly no idea about what to do, but there is so much new stuff and I'm afraid to get lost in it.   I've searched some by myself, but there so much articles that leading to 3D graphics, which is not what I want, and there is even more about it written by Java (I'm looking for C++). I mean, I know, that all the difference between them is model-view matrix, which says, is perspective needed or not. But then there is quite a lot talking about how to render a cone, a cube or whatever 3D thingy. And then how to put the light and many more unnessesary information (for my needs, of course).   I want to learn about how to make sprites, how to texture them, optimize, etcetera.   In because of that I decided to ask you, guys: where can I find some guides for novice graphic programmer about how to build my own graphics engine?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!