I really want to start doing a tile game, and I've started Cocos2d because of the popularity of it and the availability of tutorials and resources.
But I really want to try out some procedural map generation, but unsure if Cocos2d is the one for it.
If it comes to it and Cocos2d isn't best for this then my other options are Java or Love2D, this isn't iOS but oh well!
Because Cocos2D loads map files from an external source, what you want to do is write some code to generate a map file using the syntax described in this manual page, save the generated map file, then load it using Cocos2D's tiledMapWithTMXFile function (more information here)
for more information on writing a proccedural map generation algorithm, the Procedural Content Generation Wiki is a great resource.
A tutorial on procedurally generated caves, but it could work for top down maps and what not.
http://gamedevelopment.tutsplus.com/tutorials/cave-levels-cellular-automata--gamedev-9664
Related
Apologies in advanced for my lack of experience in Java programming. I'm trying to create a profile generator for drawing the 2D outline of a gear as a polygon of many points, and am looking for a means of storing this profile in a DXF format. Currently, I've been using the program, OpenSCAD, to generate the profile using an iterative method, and it comes with the option of exporting 2D geometry as DXFs. The results are decent, but the program lacks the proper programming language to work with more complex gear profiles; this is why I want to use Java (the programming language I'm most to grips with) to generate the gear profile. The problem is, I'm neither familiar enough with Java nor DXFs to know how to use the former to create the latter! I reckon however that if OpenSCAD, or even Dr. Rainer Hessmer's gear generator can create their own DXF files, why can't Java. I've passively picked up that a DXF file is much like a text file, so if there exists an approach similar to writing a text file in Java, that would be the most preferred option.
Many thanks and I appreciate any help.
Why not use Java to generate OpenSCAD code (as a text file) which can generate the gears? There a a fair number of tools which use Python to do this.
I am trying to make a GWT based web application which will be able to show 3D model from PTC Creo's .stp (STEP file). I am programming in Eclipse.
I started with Parallax3D framework, and I am able to make simple objects. But I'm stuck with how to parse the .stp file and make objects from that.
Later I saw that there is plenty of other tools for 3D on Web. There are "gwt-g3d", "gwtgl", "gwto3d",....
I also found JSDAI API, which should be able to parse .stp files. With very limited examples I couldn't manage to do anything usefull.
I am lost with all those things. Which path should I take?
Has anyone done that before OR is there a simpler opensource solution for that?
Thank you.
You could use the NIST STEP File Analyzer (free but not open source) to convert the STEP file to VRML/X3D. Three.js based frameworks can then view the VRML/X3D. If you want a completely open source solution, you need something to transform the STEP file, which often contains NURBS trimming that three.js lacks, to a tesselated form. FreeCAD, pythonOCC, node-occ or the underlying OpenCasCade can transform STEP to a mesh form.
I'm trying to implement a road map in my desktop Java application.
The idea of my project is so allow the user to place points onto a map where a specific photo was taken.
I was going to use Google maps, but reading the T&C, I noticed it has to be used on the web only. I have managed to implement a map onto some free web hosting (http://jwasley.netii.net) - but it won't display in the Java web browser I created.
Is this the best way of doing it, or is there an API for road maps. I did look into OpenStreetMap but couldn't find any decent tutorials.
Cheers
I suggest using jxmapkit as a Swing framework for displaying maps. It includes powerful features such as overlays. It is part of the swingx project. I believe it supports a number of different mapping repositories including OpenStreetMap.
You can see an example here:
http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html
If you would like to see more then the open source project iphoneanalyzer uses it extensively. The code is available here:
http://iphoneanalyzer.svn.sourceforge.net/viewvc/iphoneanalyzer/trunk/gui/src/main/java/com/crypticbit/ipa/ui/swing/
So I'm not 100% sure if it's possible, but what I'd like to do is take a model that someone has created for a game, say in Blender or something similar, in various formats, and from that create an image to show on a website.
Are there any Java libraries around that could help me with that? Java3D maybe? Or even something in Flash? Ideally you'd be able to rotate the model in some embedded flash app, but I'd settle for a plain old image.
It depends on how far you want to go. Most models are going to be in a standard format- or can easily be converted to be - and most 3D Apis are able to load these formats in.
It would be a little unusual to do this on a server - you may even need to have OpenGL installed on it - but it should be quite easy to load a model in to a 3D environment and take a snapshot or a series of snapshots quite easily. Possibly even use these to create a short video clip of a complete turn around the model. If you're using Java take a look at some of the things people are working on over at http://www.javagaming.org/ - I don't know that Java3D is in use much still but there are other good 3D java environments around. JMonkeyEngine looked most interesting last time I was exploring that area.
Alternatively you probably can set up a way of loading the model into a clientside environment - I don't know if Flash can do 3D stuff now, but Shockwave certainly can ( although it's horrible to work with ) and I believe the Silverlight stuff likewise. Of course unless you are pregenerating your animations you are likely to be passing the model to your display logic on the client and a savvy user could intercept that, but the risk is probably reasonably low and from your question it's not clear whether that would be a problem to you.
Take a look into this post:
http://techblog.floorplanner.com/2010/01/25/introducing-asblender/
"Enter ASBlender, a library I slapped together in a few days to read Blender’s .blend file format and parse it to AS3."
lucky you! ;)
EDIT: added link for the project:
http://github.com/timknip/asblender
EDIT2: With the asblender library you can parse directly the .blend file (this is the working file, not a exported file format). Once you have the file inside the flash application you can use Papervision (I believe you do the same with other 3d libraries) to render the model, this way you can do a single image of the model or you can let user to see the model rotating. Beware that any of this libraries won't give the same render quality that a 3D application like blender is capable of. The good thing about this library is the capability of reading all the info in the scene, so you can match cameras and lights to be as close as possible to the original .blend file.
Alternatively there are also other parsers like Ase, Collada , DAE, KMZ, Max3DS, MD2, Sketchup, SketchupCollada... all of this inside papervision library.
I wonder if anyone is able to help or advise with the following; I have to be able to take data from a data source and to be able to visualise that data as a decision trees on a web page all. This will be a single process which is seamless to an end user.
This will be done using JSPs and Java servlets but what concerns me are the underlying products. I'm thinking of passing the data to a Weka classifier and then doing something with the .dot file it creates, i.e. maybe feeding it to GraphViz or trying to use the Google Visualization API to present an interactive display.
But, can anyone tell me if this is a viable approach or suggest alternatives?
Thanks
Martin O'Shea.
I've had a lot of success creating data flow graphs with graphviz (I uploaded them with a script to a MoinMoin wiki and used the graphviz plugin). That plugin even allowed to have links in the graphs, so we could keep the individual graphs small.
For the UI we have added the JS stuff from http://www.mxgraph.com/ to display larger graphs to the user.
Your approach is viable however. GraphViz is a good tool.