• Content Count

  • Joined

  • Last visited

About michahell

  • Rank

Contact Methods

  • Twitter
  1. Yeah i just started reading about Angular, it really solves the problem of CRUD webapps, not really useful for games. Something like Phaser sounds right on! i'll try that. Hmm, i don't really agree with viewing games as being some sort of MVC framework by default, you still have to manage at least some sort of different screens somehow. That should be structured in some way, and you might also need a lot of classes / objects for things in your games, they might be Sprites but they might be more than Sprites. I'll check out phaser, thanks!
  2. Hi! This is a question i have been asking myself for a while: What framework are you guys using in combination with a library like Pixi to create games? Do you only use Pixi, do you use Pixi + angularJS or Pixi + some very tiny MVC framework? Why i ask this is because every game has different screens. for example, a title screen and a main game screen. then there can be a 'how to play' screen, highscores, etc. etc. I am currently looking into AngularJS (mostly because i want to have an excuse to finally start learning it) scaffolded with Yeoman. Is there maybe even a Pixi generator i am not aware of? that would be awesome. Thanks for any advice.
  3. Hmm, that's a very nice way to approach this problem indeed, and far easier than i've been finding I will definately use this if i ever get my game big enough to feature cities! I've for now found a different solution, i changed the concept of cities to towns and i now have a working basic 'town generator'. The 'algorithm' works this way: 1. pick a random vertex from all of the voronoi cells 2. check if this vertex has at least 3 outgoing edges that satisfy a length requirement (the edges will become the town streets) 3. designate the random picked vertex as a 'town candidate'. 4. for all 'town candidates', have some requirements to check for and filter for these. (currently i just select randomly for a maximum number of towns :> ) 5. populate the town, put houses on each side of the edges (for me this was a shit ton of trigonometry, but still doable apparently haha) Work in progress screenshots: http://d.pr/f/wJxe The working version (no preloading, slow, unoptimized, etc. etc.) can be seen here: http://www.powergeek.nl/proj/mongento/versions/9/ As for other people running into the same problem: (also on S.O.) As i was looking for my problem, it turned out to be a fairly complex one, both measured in difficulty to implement as algorithm, as algorithm complexity.If anyone is having a similar problem, these problems are classified as 'packing problems' in general, with specific problems like the 'pallet loading problem'.The problem i was interested in, is illustrated at the bottom of this page: https://www.ime.usp.br/~egbirgin/packing/ and a paper about this problem, with algorithm descriptions of how to solve the packing problem for convex polygons and curved shapes: http://www.ime.usp.br/~egbirgin/publications/bmnr.pdf Some more information on these kinds of problems: http://lagrange.ime.usp.br/~lobato/utdc/http://mathworld.wolfram.com/SquarePacking.html
  4. michahell

    Polygon subdivision

    I would like to be pointed to information / resources for creating algorithms like the one illustrated on this blog, which is a subdivision of a polygon (in my case a voronoi cell) into several boxes of varying size: http://procworld.blogspot.nl/2011/07/city-lots.html In the comments a paper by among others the author of the blog can be found, however the only formula listed is about candidate location suitability: http://www.groenewegen.de/delft/thesis-final/ProceduralCityLayoutGeneration-Preprint.pdf Any language will do, but if examples can be given Javascript is preferred (as it is the language i am currently working with) A similar question is this one, only the polygon is a rectangle: http://gamedev.stackexchange.com/questions/27055/what-is-an-efficient-packing-algorithm-for-packing-rectangles-into-a-polygon I also posted this question on Stack Overflow, so if you want upvotes answer there : http://stackoverflow.com/questions/19259359/subdividing-a-polygon-into-boxes-of-varying-size
  5. Just happen to find this question, have you been able to solve it? might it be because you are looping from i = 1 onwards, not from i = 0? I had the same error you had, it turned out there were simple errors in my drawing logic.
  6. Thank you guys for your replies, i think i understand what you mean @rolnaaba, although i still not understand how to approach a WebGL context as a 2D canvas context, is that possible? and IvanK, i've worked with your library before, it's pretty awesome, definitely if you come from AS3, which i do. I think it's far better to come up with a better way to position individual elements, which i think you mean by saying 'geometric model'. What are your ideas on this? do you know any good sites that explain how i can get a good geometric model? I've read some terrain generating tutorials in which one solution is to use a physics-based 'spring-model' to position trees, and another one is trees with a surrounding circle in which other trees cannot grow, is that what you mean by geometric model? As to what i am running into, at the moment buildings (and trees) are placed randomly, and i have some basic checks which check if trees are placed on top of each other (if sprites overlap) but that's it. I'd like a better 'model' or ways to check where things are placed, for example, if you look at my latest working version here: http://www.powergeek.nl/proj/mongento/versions/8/ You can see that trees and farms are placed over hedges. I have no idea how to write a check that checks if a building or tree is NOT on a line, for example. That's why i was resorting to alpha channel checking, but that's quite intensive to do if i want to have 1000 trees, 200 buildings etc. etc. any suggestion is welcome! Thanks again!
  7. Thanks for this, but i forgot to mention that i use the WebGL renderer
  8. Hi forum, I am working on a proof of concept for a game where i need to be able to place buildings (like any RTS you know). I already have some terrain generation going (I do not use tilemaps) with trees and later on other stuff. I'd like to know if it is possible somehow to calculate where a user can place buildings, and possible even draw (using PIXI.Graphics) a green colored area (around the building) where it is possible to place / install it. Circle based collisions would help at this stage, but alpha channel transparency checks would be better: i have tree textures as transparent 256*256 and 512*512 PNG's with shadow, i'd like to know when a building is being placed right near a/some tree(s). http://www.powergeek.nl/proj/mongento/versions/5/ (no preloader, working version. zooming is buggy but too lazy to work on that right now :> ). Thanks for any tips / pointers!
  9. I have a question about this, i have a layer of generated trees in a displayObjectContainer, i wish to swap their depths based on their scale (large trees > small trees) but just swapping isn't enough: I need their index to see if one is above the other. Since the display object (?) properties ._iPrev and ._iNext are unfamiliar to me, can i use these properties to find out if one tree is higher in the display list than another? or for that matter, a modified version of your function? :> Working version: http://www.powergeek.nl/proj/mongento/versions/5/ (no preloading yet, wait for trees to show :> )
  10. Hi, this is quite cool what you've built, it gives a pretty smooth feel, i like it! it made me think of an oldskool DOS game i used to love, called Solar Winds. That game had a huge free galaxy to do stuff in, for the time (i think). awesome! If the project you're working on is not active anymore, let me know, i've been waiting to recreate something like solar winds for a long time