Calculate forces on a box - c#

Story: I am developing a construction tool for wooden boxes. A box consists of a set of boards, each board is represented as 3 3D-vectors, and one placement vector. Each box is visualized using OpenGL.
Now, these boxes will be moved around with forklifts, which will apply some forces on them. I would like to calculate the forces on each board in the box, such that I can see if a given construction is stronger than another, if any board is stressed too much etc.
How should I attack this problem? Are there libraries available I can use? Which books should I read to guide me on this? Can I use existing CAD tools to do the physics experiments?
I am using C# to compute everything, but this is not a requirement (though it would be nice).
Edit: What about libraries such as ODE and Bullet? Won't they be able to answer my question?

Before you can implement any computational devices here, you need some modelling. The problem of forces and stresses over a problem like this, with changing set-ups is a very complex one. What you do in Civil Engineering normally is modelling the building (or in this case the box) and use a finite element program to calculate stresses and forces. You need to make assumptions regarding the resistance of the materials.
In short, get a Civil Engineer or someone very knowledgeable in material physics to help you.

I second tekBlues' answer; you need a real civil engineer to work with on this. In particular, ODE and Bullet cannot help you. Both are designed around the physics simulation needs of video games: simulating the movement of unbreakable rigid bodies composed of primitive shapes very quickly. How they do this is only vaguely related to the workings of Newtonian mechanics. In particular, they don't keep track of forces propagating through a system of objects in any way that's useful to you.
I'm sure software packages exist to do this sort of thing, but I'm not personally familiar with any. Again, you need someone with experience doing engineering simulations.

Related

Cloth digitizer! Making 3d models of real Cloths

I have this project of mine that I'm working on. It's for a clothing store, He need all his clothes to be available as 3d objects on the PC for different purposes later on.
I've been doing some research and I guess the only possible way is to get a model that wear each cloth, she stands on a board that will rotate in one way and a camera will.be taking shots at different angles.
I might be complicating stuffs but I need to know if there exist any other techniques for achieving this.
I don't mind any idea even if it requires electronics. Some hints will be helpful.
I think what you are searching for is a program called reconstructMe
here's the link.
what you need is a Kinect.
some other programs are also possible simple google search
I hope this helps!
edit:
if you want to do thing yourself, you might want to take a look at point-cloud-library here. It does require some C++ coding, I am working on a C# version though, so for more info on the wrapping you can msg me.

C# XNA: AI Engine?

I'm developing a game with zombie running around in a swamp. I want AIs to have functionality like "chase this target" or "run away". A major stumbling block is pathfinding. Is there a good pathfinding/AI engine in XNA, or should I roll my own?
Does anyone have any experience with this: http://www.codeplex.com/simpleAI?
you may want to look for A-Star algorithms... here is an article that talks about it in the context of a winform, but mentions XNA.
Roll your own! Seriously.
I take it you're making this game as much for the enjoyment of coding, as you are hoping for fame and riches? Pathfinding is one of the staples of AI, and is a well studied and documented topic. It is an excellent introduction to a field you'll need knowledge of in future game endeavours.
The A* Algorithm (as mentioned by others) is the standard solution to this problem - but try other approaches: line-of-sight, scripted movement, flocking... often you can derive interesting behaviour from combining a few techniques.
For a book on the subject, try AI For Game Developers - not the best in the field, but certainly an accessible introduction for the lay-coder.
Have fun mucking about with the zombies!
http://xnapathfindinglib.codeplex.com/
http://swampthingtom.blogspot.com/2007/07/pathfinding-sample-using.html
To everyone that's suggesting A*: you generally wouldn't put vanilla A* into a game. There are a lot of improvements and extensions for A* including (but not limited to) IDA* and transposition tables, that improve performance with A*-based search.
You might want to use a library to get you started but you may ultimately benefit more from your own custom implementation, using your own data types native to your app, instead of having to marshall data back and forth. But you'll need to profile to be sure.
The XNA Creators club has samples for Chase and Evade and Flocking.
I've just started down the path, but they seem to have some good resources on the creators.xna site.
I'll be using some pathfinding logic in my game, the A* Algorithm seems to be the winner for me.

collision detection with lots of objects

I have around several hundreds of moving objects within screen at the given time, plus a thousand+ stationary objects. For simplicity, you can think of it as a billiard game with damn lots of balls :) Some of them are stayin still, some others are moving at all sorts of speeds to all sorts of different directions. I need coll detection each time each ball bumps into another ball. What is the best method, considering performance and, well, programming simplicity? I'm talking algorithm only, I guess I can implement it myself, tho suggestions on implementation are welcome as well ;)
Language is C#, XNA 3.1, 2D graphics, target platform is Windows only (if that matters). Thanks in advance for your help!
You might want to take a look at the answers to this question.

Personal Project Planning [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I want to design a 2D game idea with C#/XNA. Between school, project inexperience, limited resources, and other things that may cause me to bail on the project I am going to try to plan it out before I jump in:
What are some key aspects you've noticed in a successful personal project?
How did you (successfully) draw revenue the project (besides asking for donations)?
(Note: this is not the main purpose of my project but would be nice!)
How do you plan non-programming aspects like window layouts (UI), flow of game, and look and feel?
How do you bring an abstract idea of a game and making into a real product. What tools do you use in your sketching and planning?
With limited resources (artistic talent and money), how do I create some of the art resources I need (besides stock art)? Or should I not worry about that until I have a finished product?
Finally, how do you break barriers in your code (may it be knowledge, time, or perseverance)?
What are some key aspects you've noticed in a successful personal project?
I suppose this largely depends on your definition of success. I consider a game project successful if:
It's fun. Enough that I want to play it after I've finished.
I learn something in the process of making it.
I actually complete the project, where complete is defined as having art, audio, and any other assets adequate for the style of game that I'm making.
It works under 'field conditions', rather than simply on my own machine/hardware configuration.
In my case, every project that I've considered successful has been one that I've done some serious planning on and committed to seeing through to completion. That's the biggest step for me to get past. A casual project that is the product of a bored weekend usually won't get finished.
How did you (successfully) draw revenue the project (besides asking for donations)? (Note: this is not the main purpose of my project but would be nice!)
Heh. Haven't managed this yet. But then, that hasn't been a concern of mine enough to do the work required to support it. Someone already mentioned the potential revenue from XBLA for XNA projects, which is a very easy avenue to success if your project is the sort of thing that translates well to the console. I've looked into it, but it isn't really appropriate for my projects so far.
How do you plan non-programming aspects like window layouts (UI), flow of game, and look and feel?
Pen. And paper. I draw a lot of screenshots as guides and I'll usually have some kind of artistic theme in mind to go along with the gameplay. Rapid prototypes help here too; everything from making mockups of menus and various screens in a drawing program to making some simple interactive stuff in a throwaway project.
Write everything down. I take lots of notes and I've been known to have a laptop with notepad open on it sitting next to my development machine, to save me the trouble of alt-tabbing away from my code to type a quick note on what I'm doing. Some great ideas come out of the process of trying to make other things work and if you don't write it down, it didn't happen.
How do you bring an abstract idea of a game and making into a real product. What tools do you use in your sketching and planning?
Work iteratively as much as possible. I hate to sound cliche, but the whole agile model works really well for games. Start with that core 'fun' idea you have that inspired you to make a game in the first place and get that working in code. Maybe it's a single mechanic that you want to build puzzles/levels around or maybe it's more of a look/feel that you can capture in a single environment/level/whatever. Either way, if you can get a single example of it working right, it becomes a good check on whether the idea is actually viable and will likely give you some ideas of the different ways it can be implemented. That might seem kind of vague, but more specific advice would depend on any number of other factors (your choice of genre, audience, the specific ideas you have in mind, etc.).
With limited resources (artistic talent and money), how do I create some of the art resources I need (besides stock art)? Or should I not worry about that until I have a finished product?
Peter Molyneux of Lionhead has said that he used to prototype all of his games with ascii art. If they were fun with that limited level of graphics, then they were worth continuing. While you might not be able to get that simple with some genres (and an ascii 3d shooter might be novel for it's own sake...), certainly worrying about finished art, audio, or other assets is something that can be saved for much later. In the end, if the game is fun to play, then getting an artist willing to work with you becomes a lot more trivial. I have, on many occasions, used copyrighted assets during my prototyping phase when I just couldn't stand to look at my own art any longer. Just be sure that you have anything like that replaced before you start distributing your project...
Finally, how do you break barriers in your code (may it be knowledge, time, or perseverance)?
Not sure exactly what you're thinking about here, but breaking barriers is what writing code is all about really. You're finding creative solutions to interesting problems. The web is a great resource for general knowledge, but in the end, it's your own time and perseverance that will create something interesting.
Best of luck.
What are some key aspects you've noticed in a successful personal project?
Don't worry about how it will turn out
Do it for fun
Don't plan it
Start small, don't think big
Actually code instead of procrastinating on so or other similar sites
If you want somebody else to use this game, make it non personal. Get somebody else who you can give demos to and get feedback from. Make the game very very simple. Build that first before moving onto something very simple. Then go for simple!
not sure :)
Plan with pen and paper sketches for window layouts and game flow. For look and feel, browse the web for slick looking sites you can take inspiration from.
Use notepad, and write the shortest list of things that need doing to make the simplest working demo. Only work on the things you wrote down otherwise you can get carried away on some detail and end up not producing anything useful.
Art is an important part of a game, and you can't have a finished product without it. How about searching the web for a collaborator who'd be interested in doing it for you.
If your stuck with something in your code, ask for help on StackOverflow! :)
Key aspects: Primarily, something that you are excited about. Make a game that REALLY gets you going, and you'll be motivated by your desire to share the finished product with others -- your end product's quality will probably be improved by your passion, as well.
Profitability: Well, since this is XNA and all, if you release a version on Xbox Live, you will earn 70% of the sales revenue that your game earns. Games can be priced for 200, 400, or 800 points (roughly $2.50-$10).
UI/Usability: For this, I typically go through a lot of playability testing...booting it up, seeing how things "feel," then tweaking things if they just don't feel right. I came across a lot of things that I never really thought about before (fade-ins/fade-outs for menus, repeat rates for keys, and so forth), and play-testing is one of the more effective ways that I've been able to identify issues like that. If you've got friends, you can ask them to give you feedback as well.
Planning Tools: Truthfully, I just make a list of the things that I want to include in the overall game concept, then slowly get more granular as I iron out more and more of the fine details. Certain ideas inevitably change after playtesting may reveal them to not be as fun as you had imagined they would be, of course. I haven't ever seen a huge need for any formal tools for this process, though, but I will give the disclaimer that all of my projects have been fairly small in scope and have not been professional-sized undertakings or anything.
Art: This may not always be an option for you, but I have a few friends online that are gifted with art skills -- I solicited interest, and got some volunteers. I presented the option to earn a cut of whatever royalties may come in, but most of them were happy with an attribution in the credits and a chance to see their work in a game that's playable by people all over the world. Regarding small things (icons, etc), stock/royalty-free art can do the job in certain cases, too, but I wouldn't recommend relying on it.
Breaking Barriers: Not sure what's quite meant by this question, but generally speaking if I've come up against some sort of unforeseen issue (technical/implementation challenge,
gameplay-related, or what-have-you), I'm able to either solve the problem or come up with a suitable work-around if I put my mind to it for long enough. Did you mean something else by this?
Some great thoughts given in these articles:
http://www.flatredball.com/frb/docs/index.php?title=Tips_for_Completing_an_Independent_Project
http://makeitbigingames.com/2006/06/five-realistic-steps-to-starting-a-game-development-company/
http://makeitbigingames.com/2006/02/five-foundational-steps-to-surviving-as-a-game-developer/
First of all - I know universities don't tend to teach this but you really must do it... get source control going. I would suggest installing TortoiseSvn from here: http://tortoisesvn.net/downloads
With TortoiseSvn (a subversion client) - you can create a repository on your USB Flash Drive and carry it around with you, so you always have a copy of your project files. More importantly you can have more confidence when you make changes - because it keeps a history of the changes you've made. So if you break something, you can revert to the most up to date version on your usb flash drive... or even an earlier version if you wish. It also provides ways of showing differences between file revisions, all from the explorer shell extension.
For a personal project the key thing is to keep motivated. You keep motivated by setting yourself attainable tasks. Aim for something attainable. Always make sure you can build your project. Concentrate on adding new functionality while keeping the old stuff still working rather than building up huge nicely designed framework that might end up going no where. If you write your code well, you can refactor and abstract later after you figured out what game it is you actually want to build.
I would advocate a todo list of some kind... something like the spreadsheet found here on Joels site: http://www.joelonsoftware.com/articles/fog0000000245.html
If you want to get fancy, I would suggest something like Trac: http://trac.edgewall.org/
Trac is a wiki, to-do / bug list and repository viewer all in one. If you get someone else working with you on a project, collaboration with source control and a shared wiki becomes more useful. It's also good to work with others... you can keep each other motivated.
The Wolf fire blog recently had some interesting design ideas and cited serval sources here: http://blog.wolfire.com/2009/02/design-principles-from-tufte/
As for getting money, others have already covered the community games thing.
Art assets - there are a few places to find these. Scout the forums at www.gamedev.net. Def look at this blog here for some excellent art (and game design ideas) http://lostgarden.com/
Others have suggested keeping tools simple - I would agree. The simplier and more accessible things are when it comes to project planning, prototyping and design - the more likely you are to use them. As long as you can communicate with yourself when you revisit something... or other people when collaborating, it's a good tool. Set yourself attainable goals, and get on with it :-)
What are some key aspects you've noticed in a successful personal project? Focus on something that actually works.
How did you (successfully) draw revenue the project (besides asking for donations)? Not directly. However, skills get you a job. Build skills.
How do you plan non-programming aspects like window layouts (UI), flow of game, and look and feel?
Build the inside -- the core data model first. If the data model works, everything else is far simpler.
Build unit tests for the model to be absolutely sure it always works.
Work out "flow" and other control issues based on that model.
Build the GUI later, once you have a solid foundation.
How do you bring an abstract idea of a game and making into a real product? What tools do you use in your sketching and planning?
I do the following.
I use Argo UML for technical UML diagrams.
I write documents with my end-state in mind. What the API will be like. How it will work. As part of writing the documents, I clarify my thinking.
I write code in pieces, with unit tests, and refactor ruthlessly.
With limited resources (artistic talent and money), how do I create some of the art resources I need (besides stock art)? Or should I not worry about that until I have a finished product?
Find an artist who wants to help.
Finally, how do you break barriers in your code (may it be knowledge, time, or perseverance)?
Build the inside -- the core data model first.
Spike elements of the technology separately from the main development. Build separate proofs of concept for each new technology. Do not try to integrate unknown technology into the final product. (Many of my customers try this and it doesn't work.)
Having had an experience with game development in my teenage years what I can suggest is the following:
Make sure you have the story ready, or at least the basic points before you start implementing. Also make sure that you do not change the genre of the game while in dev stage. (yeah, I know, this is stupid, but could happen ;-) )
We actually drew some revenue when we managed to sell the game to a software house, however because we had already spent too much in the dev process, we just broke even (i.e. to little profit). So be careful what you spend beforehand
From what you said, you're still in school, so take advantage of that. There will surely be folk out there with artistic talent, most probably friends of yours. Make a team. That's what we did and it was all the way back in 1993! At that time it was even harder. We introduced our talented friends to 3D-Studio (v3 back then) and some even to computers in general, and believe me, before you knew it they were making brilliant art out of it!
Use pen and paper to create the story boards (even better with the friends mentioned above. Decide on the development approach. I.e. what libraries will you use etc. Read a lot about game dev. Make a plan of the project. Give it your best ;-)
Unlike us back then, you have the web to help you. For whatever problems you have with your code it is easy to look it up. StackOverflow didn't exist back then!
And of course make sure you have fun in the process otherwise it will eat you alive!
What are some key aspects you've
noticed in a successful personal
project?
Just do it!

OpenGL game with multiple entities on screen at once, what language to use?

Going to create a small game with OpenGL as a side project. Going to be a top down shooter with emphasis on large numbers of enemies (the more the merrier)
Thinking about having the resolution max out at 800x600 (for an old school feel)
What language would you recommend, is C# capable of handling the number of entities I want on screen (60-100) or should I try out C or C++ or even some other language.
Do you have any other suggestions when going for a project like this, special documentation you recommend etc.
C# is easily capable of handling a few hundred objects at once. The real speed issues come from rendering, which will not be in C# space, and possibly any computation you want to be done for each object, such as physics. Ideally you'd be using a library such as Box2D or Chipmunk for that anyway, making C# speed a non-issue there as well.
I'd personally be willing to write a game such as this in even-higher level languages than C#. C# should easily suffice.
On the scripting languages tip, consider the excellent Pygame in python:
http://www.pygame.org/news.html
Or the newer LÖVE in Lua
http://love2d.org/
For a top-down shooter both are probably excellent choices.
Have you considered Haskell, D, or ADA?
C# will definitely be able to handle a paltry 60-100 OpenGL-rendered entities on any reasonable hardware.
Generally, for a project of this scope I would recommend using whatever language you want to learn next.
Your project scope isn't huge, but is meaty enough that it would probably stretch your knowledge of the language you choose a bit. So choose one you want to get better in.
I've only ever dabbled with it but LWJGL will facilitate a Java version. All of the in-house games at puppygames.net are done in Java with LWJGL, for instance, and curiously they too are top-down or side-on blaster style games.

Categories