# Deban

Members

39

• Rank

• Gender
Male

2. ## Looking for research materials for multiple shape id interactivity

Octree and quadtree are the same thing, the former is a 3D implementation of the last one. Let's see... For what I understood, you use the shapes to check if they collide. Collisions are divided in 2 phases. The broad phase and the narrow phase. The broad phase is checking what can possible collide, the idea is to avoid using a free 4 all check (everything with everything). The common way to do this is by spatial partition, dividing the space in sectors. In 2D the common approaches are: a common grid (also called hash table), a quadtree, binary space partition and sweep and prune. Spatial partition means getting everything that is in a zone, or even near a zone. You can use this algorithms even if you are not checking for collisions. Which algorithm to use, is heavily based in your game, how many objects you have, how much they move around, it's an open zone or a closed one, etc... Here is an excellent article on hash table to get you started. The narrow phase is checking if the objects that can collide actually do it. It's the common collision algorithm. Some people divide this in two steps, first a fast but inaccurate test to narrow the possibilities, even more, and then a expensive but exact algorithm. The algorithms are (in order of complexity, accuracy and inverse speed): Circles. The most basic, the distance between the centre points of the circle should be less than the sum of the radius for the circles to collide.Axis Aligned Box (AAB). Which is a rectangle that can't rotate.Oriented Bounding Box (OBB). A rotated rectangle.Separating Axis Test (SAT). This is where you start to get a lot of control. You can use any polygon to test against any other polygon. The more faces, the slowest it becomes.Minkowski Difference. This is a different way to solve the same as SAT. You can use multiple polygons checks. Choose this or SAT based on which one you understand most.This page contains all the algorithms except SAT. For SAT you can look here.

4. ## Scoring engine

How about plus and minus? var availablePeople = 0;When a room is created: availablePeople += 2;You can give each room a requirement of necessary free/available people to be created. Bedrooms have 0 as requirement for example. And then a room can generate/consume people. function OnCreation() { availablePeople += this.peopleGenerated;}function OnDestruction() { availablePeople -= this.peopleGenerated;}It's consumed if peopleGenerated is negative. If you have different pools of people to consume, create different variables. Treat it like resources, mana or gold.
5. ## Looking for research materials for multiple shape id interactivity

I'm sorry, I don't really understand (specially the pseudo code). Where you have the grid? What does it represent? How do you code that grid? I will try to help, but probably it won't be really useful (with the 3d mesh you completely lost me). This are examples to give you ideas, change it as you see fit. The grid code: var grid = [];var rowsAmount = 10;var colsAmount = 10;for (var x = 0; x < rowsAmount; x++) { grid[x] = []; for (var y = 0; y < colsAmount; y++) { grid[x][y] = new Shape(/*Chose type here*/, x, y); }} The shape constructor: function Shape (type, x, y) { this.type = type; this.id = ++Shape.lastID || 0; this.position = {x: x, y: y};}And lastly getting the shape and it's surrounding shapes: var selectedShape = grid[selectedRow][selectedColum];var id = selectedShape.id;//The surrounding shapesvar surroundingShapes = [];//How many shapes I will select on each size, it's like a radius but the figure of the selection is a square.var sizeOfSelection = 4;//Current positionvar posX = selectedShape.position.x;var posY = selectedShape.position.y;for (var xOffset = -sizeOfSelection; xOffset <= sizeOfSelection; xOffset++) { for (var yOffset = -sizeOfSelection; yOffset <= sizeOfSelection; yOffset++) { surroundingShapes.push(grid[posX+xOffset][posY+yOffset]); }}Without knowing how you implement things, I can't help you much more.
6. ## Game idea, need help from the PRO´s.. (Thats you guys!)

That are not programming questions, they are game design. It's great that you answer them before asking the programmer to code them, but you programming knowledge has nothing to do with it. As a side note, if you are making your game in HTML5, it's cross-platform already. And even works in mobile, not great because of the different screen sizes, but works. Maybe knowing about how programmers usually behave will help you deciding. This is how it usually works, the stereotype, but there are lot's of types of programmers. Programmers won't create levels for you. They won't create a GUI either, they will place your images in the place you ask them, but not design it. A programmer will only create the behaviour of things, commonly even only the general behaviour and you have to do specifics (this varies a lot in the size of the project and team). Changing things is hard, sometimes really hard. Mock ups, or rapid prototypes created to test an idea can't be cleaned and call it done. It needs to be fully re-write to works. The bigger you game, the more important this becomes. That's comes to the top of my head. Good luck

10. ## Help with turn-based game

The most probable thing is that you turn base game won't be pure turn based. I meant that there should be sounds and music running and even animations playing. That means that your game have 2 parts, the one that updates it current state regardless of whose turn it is and the one that what for the player. The first part is like a normal game, with a game loop. That part you should know how to make. What it's generally done for the turn based is events. You wait for a specific event (like a click in done) and then inside that function is where most of the code regarding of the turns resides. Think in a Tic-Tac-Toe. Your normal game loop run animations, sounds, maybe a score or time. And when a user clicks, you do things that you would do normally in a game: check if the place is empty, then create a thing in there and lastly check if someone win. It's exactly like a normal game, you check collisions and allow to move in a place or not, you spam things in the map and check if the player dies or finish the map. The only difference is that a lot of things, instead of doing it inside a game loop, you do them in the event that represent the interaction of the user (clicking in a unit, click in a position to move the unit to, ending the turn, etc...). It's not that different from the player controls or a menu. Good Luck with your game!