Cellular Automata in Java 3D - java

I have created a Cellular Automata implementation in Java 3D. Everything is working correctly but I would need some starting patterns to start off with. As of now I have 2 cell states: Visible and Invisible.
Now my question is: how would I define a cylindrical pattern, for example, of Visible cells to initiate the simulation with? I have searched the web but I'm not getting any results, it seems. Is there some sort of formula to define the bounds with for a cylindrical one?
Any advice or pointing me in the right direction would be highly appreciated!
Thanks in advance.

Have you heard of Conway's Game of Life? I imagine you have, but just in case it's a cellular automata turn-based "game." There are a few good "starting positions" on the Wikipedia page.

Related

Java2D pathfinding in 2D space shooter game

I'm writing 2D space shooter game, something like space invaders, kind of. Right now I have to decide in what way
I will be moving enemy sprites and I can't move forward until I will implement some kind of solution.
Newest version of game source code on my GitHub page (link in profile).
OK, so to the point. First of, I'm using only awt. I want to learn a lot, so I'm not using external libraries in this one.
I want to move my aliens on a 1280x800 field with no obstacles (except other aliens and player).
First I tried to move aliens on predesigned path constructed with Bezier curves, but I was unsatisfied with the result.
Solution lacks flexibility. So I decided to write AI for all aliens and program behavior that way. Unfortunately I didn't wrote
any pathfinding algorithm, and when I started learn about them I couldn't find anything appropriate to my situation. There is a
pathfinding algorithm for finding way in graph, but should I treat every pixel as separate node,
or create logical nodes (couple pixels on couple pixels each), and is it a good way?
Don't take me wrong mates, I'm not looking for fast to build, easy solution. I just need some pointing in right direction,
since my research didn't provide me with enough information.
Should I use a Dijkstra? If yes, how to solve node problem? Or maybe there is a better way?
If you know any good web materials on pathfinding or AI, I would be thankful if you share them with me.
Thanks for getting familiar with the issue mates!

Agar.io-like cell physics

I wanted to make a circle that has a ripple-effect on the edges, kind of like in the game agar.io. I am kind of lost on how to implement it. Obviously I can't just g.fillOval() because that would draw a solid circle with no movement on the edges.
I'm not asking anyone to write any code for me (but if you really want to, I don't mind :D), but if you could point me in the right direction with some methods I should use. I am using Slick-2D library for java, if that helps.
I also tried analyzing the javascript source from the agar.io website to try to understand how they implemented it in javascript, but I was unsuccessful because the code was obfuscated; all the methods and variables were just single letters.
The only way I can imagine doing this currently is to have each circle be composed of a number of points, and let each point have it's own physics, and it can be affected by other points. If anyone who has insight into this problem, I would greatly appreciate some help. Thank you!
I'm not sure you can do this with Slick2D. It is quite high level and gives a lot built-in classes. What you want to do is really specific. As Slick development has stopped you will not get new features. You should probably look at lwjgl which is the base of Slick. It is more low-level but can be more precise with the form you need.
You can look at this project to have some drawing cool stuff. And for another example of manipulating circle you have this one

Custom 3D Rendering

So I've been prodding ever so diligently at the internet as of late and have come across some interesting games. The basic example is Minecraft4k. It was made for the Java4k contest a few years back, but what I am really interested in is how the rendering was done. There are a lot of games like this made every year, but I really can't find much on how the creators went about synthesizing 3D worlds, let alone with minimal code.
The basics that would have be implemented would be polygon filling, z-ordering, and some sort of "fog" in order to prevent too much landscape from being drawn (optional, really). I've read up on the Scan line filling algorithm and have a working example but I have no idea how to get any form of z-buffering working. So the question is, does anyone have any experience with this sort of custom 3D rendering work? If so, any tips/pointers/resources you can point me to?
I know this is a bit of a shallow and perhaps inadequate question, but I figured I would try on here. Thanks in advance!
Wikipedia is a good start point (though it is bad for me to post a link) and explains about different techniques.
I developed a 3D software renderer for dots (the simplest 3D renderer ever ;)) and the z-buffering consists of sorting an array of rendered elements according to the Z coordinate, which in turns depend on the projection you are using, either orthographic, isometric, etc. (see another Wikipedia article about projections). In the simplest projection, you simply ignore the Z coordinate when drawing object, but take it into account during rotations (as it has an impact on X and Y).

Basic dynamic 3D collision in LWJGL

sorry about my last question it was a bit all over the place.
I have hit a huge road block with a game I am coding for a friend and i need to learn dynamic collision. A tutorial would be great, a very basic one and i have already seen the NeHe collision detection tutorial and did not seem to pull much from it.
Thanks in advance to all who reply.
What you could do is create a invisible 3d box surrounding your entities and check when two or more of said boxes have intersecting xyz coordinates. I can't supply you with code, but I know it works. You would have to figure out the coding for yourself

Can Java be used to make a 2D Bird's eye view style game?

I've been working on making a video game, and I've had alot of debate between a few languages, Java can be used well for 3D games but. Can Java make 2D bird's eye view games? I'm quiet new to programming so sorry if I seem somewhat ignorant. Thanks for your time!
that's not a question can Java make a 2d bird's eye game?. the main quesiton is does a 2d bird's game created with java meet your needs or not?. just by looking at cell phones you can easily spot many 2D games using bird's eye camera created with java. so it sure can!
Yes. (This simple answer is as exciting as the question.)
I used LWJGL to make a 2D "bird's eye" game in OpenGL. It just requires setting up the perspective correctly. Performance on a laptop (with a proper OpenGL 1.6+ dedicated video card ;-) was more than adequate for a large number of objects and particles.
However, LWJGL is a low-level OpenGL/basic-IO wrapper targeted for games and is the "hard way". There are other Java game libraries (some are just 2D like Slick) to make writing a game easier. According to list of game engines this also includes Jake2, Jogre, and Java Monkey Engine (3D, but see above).
If one felt like being .. silly .. the Java 2D API could be used directly (there are cases when it will try to use hardware acceleration but there are also gotchas). I do not do any JME programming, but I would suspect there are also frameworks for it.
And remember -- a "bird's eye view" is simply the chosen projection/rendering for a given model.
Happy coding.

Categories

Resources