• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Pixbae

2d bin packing + selective grouping of objects (?)

5 posts in this topic

Hi everyone!

Let me introduce myself, my name is Francisco and I'm an architecture student. I've recently become interested in algorithmic design, which is basically utilizing math to help design (an example would be structure or space optimization). To contextualize, I'm a noob with numbers, so as far as algorithmic architecture goes, I´ve just played with some tools that help with it (Rhino Grasshopper for example, which is a 3d parametric modeler).

I want to develop a software in which I input areas (represented by rectangles) and it organizes them and presents me various possible solutions to a floor plan. I will learn programming to try and develop this, but I have so little knowledge in programming that I don't know how to tackle the problem directly.

The problem consists in trying to group a bunch of rectangles in the least possible space (not within a container, no boundaries). at the same time, I want some of these rectangles to be closer to others, so there is a hierarchy of proximity between rectangles. For example, if I wanted various possibilites of a house floor plan, I'd input spaces such as kitchen, dinning room, living room, bedrooms, etc., and it would not only group them in little space, but also ubicate them according to desirable proximities (kitchen - dinning room for example) and viceversa.

So basically, it would be some sort of 2d bin packing, but is there a way to control how the objects "pack" so I have the desirable proximities between them?

Is it possible to develop a genetic algorithm with multiple fitnesses? so it searches for various solutions taking into consideration ALL of the desirable conditions (least total space, and all the proximity conditions between objects).

Thanks in advance, open to suggestions,ideas or anything.
0

Share this post


Link to post
Share on other sites
[quote name='Pixbae' timestamp='1354643439' post='5007144']
Is it possible to develop a genetic algorithm with multiple fitnesses? so it searches for various solutions taking into consideration ALL of the desirable conditions (least total space, and all the proximity conditions between objects).
[/quote]

I think this is the key of what you are asking. You need to combine your fitness functions into a single function, which expresses how satisfied you are with a hypothetical solution. This requires careful thought, but it's basically always possible. Then you need an optimization algorithm to find configurations that reach high values of your fitness function. Genetic algorithms are only one possibly optimization algorithm, and probably not my first choice here. But figuring out what you are optimizing for is much more important than how you optimize it.

In some contexts it helps to put a dollar value on things. For instance, imagine the value of a house is increased if the kitchen is close to the dining room, and if the bedrooms are far away from the washing machine. Put a dollar value on those things, and then design the floor plan that is worth the most money.
0

Share this post


Link to post
Share on other sites
[quote name='Pixbae' timestamp='1354643439' post='5007144']The problem consists in trying to group a bunch of rectangles in the least possible space (not within a container, no boundaries).[/quote]You'll have to give an exact definition of "least possible space". A bunch of rectangles always takes the same area no matter how you put them down. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

This isn't a bin packing problem. Rather, it's akin to VLSI layout problems. Hardcore applied math and algorithm tuning, very challenging stuff. Here's a paper that has some discussion of alternative approaches and has a ton of citations and keywords with which you can find out more.
[url="http://cs.stanford.edu/people/eschkufz/research/a181-merrell.pdf"]http://cs.stanford.e...181-merrell.pdf[/url]

I am heading towards a M.Sc. in computer science, and frankly this would be too painful for me at my current skill level. The challenge is in understanding the relevant math and CS theory; implementing/coding is easy in comparison, since in this application you don't need a fast implementation.
0

Share this post


Link to post
Share on other sites
[quote name='Stroppy Katamari' timestamp='1354663863' post='5007226']
[quote name='Pixbae' timestamp='1354643439' post='5007144']The problem consists in trying to group a bunch of rectangles in the least possible space (not within a container, no boundaries).[/quote]You'll have to give an exact definition of "least possible space". A bunch of rectangles always takes the same area no matter how you put them down. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img][/quote]

Good point. The two obvious ones are the area of the convex hull and the area of the bounding axis-aligned rectangle.

[quote]I am heading towards a M.Sc. in computer science, and frankly this would be too painful for me at my current skill level. The challenge is in understanding the relevant math and CS theory; implementing/coding is easy in comparison, since in this application you don't need a fast implementation.
[/quote]

Getting started with optimization problems is not as hard as you might think. I give you two ideas.

For the first idea, you need a procedure to build a configuration step by step (adding a rectangle at a time), and then you can use some version of Monte Carlo search. As a first approach, throw all the rectangles at random a few million times and see what configuration gets the highest score. You can also collect statistics about the first steps and try promising steps more often. I have used the UCT algorithm for this kind of thing before.

The second idea is to use simulated annealing. If you have a way to make small changes to existing configurations (change the location of one rectangle?), you can get something working in a couple of hours.
0

Share this post


Link to post
Share on other sites
[quote name='Álvaro' timestamp='1354669669' post='5007252']
Getting started with optimization problems is not as hard as you might think. I give you two ideas.
[/quote]I don't think it's hard to get started with optimization problems. What I suspect is hard is designing and tuning an algorithm for the OP's question that produces actually useful results.

If you manage to find great ready-made solutions which just need to be implemented, that's a different matter.
0

Share this post


Link to post
Share on other sites
[quote name='Stroppy Katamari' timestamp='1354726415' post='5007439']
[quote name='Álvaro' timestamp='1354669669' post='5007252']
Getting started with optimization problems is not as hard as you might think. I give you two ideas.
[/quote]I don't think it's hard to get started with optimization problems. What I suspect is hard is designing and tuning an algorithm for the OP's question that produces actually useful results.
[/quote]

My experience has always been the opposite. If you know what you are optimizing for, it doesn't take much effort to put together an optimization algorithm that will produce useful results. When the results are not useful, it's usually because the fitness function wasn't properly described, and you need to think of ways to describe what you don't like about the solution as a term in the fitness function. After a few iterations, the results are usually perfectly good.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0