Open-Source Terraria Clone

Hello everyone!

I am here officially releasing the code for a Terraria clone that I have put about 60 hours of development into. You can see my progress in the thread I kept updated. The game was developed using Java and the LibGDX framework which allows it to be run on multiple platforms including Desktop, Android, and iOS. It was specifically designed for Android which means that optimization of rendering and processing is implemented everywhere it can be. The game will run at a solid 60 FPS.

Why am I releasing the code?
I started working on the game about 10 months ago. It started out as a project to develop a basic physics engine and then extended into a Terraria clone. Over the next 6 months I was developing the game, implementing the basic features of any open world game. Over the past 4 months however, I have been very busy with school, work, and other projects that have taken over my time. Because of this, rather than let the code sit around until I get the time to come back to it, I figured I’d give to the community and allow anyone to use and modify the code.

The main reason that this project is open-source is to encourage community contributions and create a game centered around the development done by those in the gaming community. Contributions are heavily welcomed and I would love to see developers being able to place their own mark on the game.

Where can I find the code?
The Github repository of course! Because I want the community to work together on this game, Github is the best place for the code to sit and allow people to work together. I would love to see the additions as development progresses.

Are you giving up on the game?
No! I am simply allowing the community to contribute and I will be developing alongside them whenever I get the time!

Current Features
World Generation: Over 1,500,000 blocks in the world.
Lighting System: Efficient with almost no boundaries when placing light sources.
World Saving: The world is split into chunks and saved to the device. It can then be loaded again.
World Destruction: Break blocks using the different tools. The action joystick will place or break blocks within a certain radius dependent on the item you have in your hand.
Item System: Pick up and use items or blocks. Blocks will be placed on the ground and items, if they’re tools, will destroy the environment
Entity System: Implement custom AI and entities with the entity system that is in place.

More information on the project can be found on the Github page.

Here is a video of the game in action!

-z4o8CwJR8E

Open-Source Release Video!

LGLSLR8y95Y

Minecraft*

Small advice ^^:
Sorry but it’s not go anywhere…
You need more ppl in team (or you project will take couple years to finish or you bored with him)
Its almost impossible find ppl in free project nowadays.

So the only option - is make multiplayer – with simple editor,
so players become that’s people who moves your project forward.
Maybe small multiplayer surviving matches: 10 - 30 min,
minecraft (terraria) engine have big Potential for multiplayer
(and very low for single player – ppl simple bored from it)

UP
P.s Android Main platform ? - No-no-no-no - you simple don’t have money for marketing
and google market (same as Apple Store) is big Trash bin
where even gold don’t see sunlight (without big sign “GOLD is HERE <-”)

or be rdy give 90% income to google Ads for promo ^^

Uhh… I don’t think you get the point of what I’m doing here. Believe it or not, not every developer is out there to make money off their work. Some actually do like to give the community and provide projects that help others learn or take part in something.

I’m not trying to “find people” to join “a team”. There is no team here that I am building, I am simply releasing the source code publicly so that those that want to use it can use it as they want. If I were trying to create a team to finish the game and make money off of it, why would I be releasing the source code? :clue: It seems like your English isn’t the best which is why you may have misunderstood the idea of what I’m doing.

sorry :frowning:

I understand - It’s not about money :slight_smile:
Its about community and players who likes and play you’re game.
(Use source code)

Its ok, and fine to do what you like and share it -
I just gave a little advice: how make game little more interesting to players
(not, how monetize it and make billions from it ^^ )

But don’t take it personal if your project not become popular
– its not because something wrong with you’re project - its simple wrong time:
We have Unity, Unreal, game makers, rpg makers, millions others open source projects…

Yes, there are those other engines that people can drag and drop components and physically code very little. But what fun is that? Are you even learning anything reusable when using those engines? If you develop a game in Unity, in what way are you going to be able to take that knowledge and apply it in another setting? You’ll be able to take your background on game design, but you won’t be able to apply many of those same principles in other game development environments because what you know can only be used in Unity.

If you take the time to learn how the actual engine works, you’ll be at a greater advantage than those who only know how to drag and drop components. I, personally, would respect a developer more if they understood the under-works of a game rather than someone who relied on an engine to do 75% of the work for them.

I feel that there are definitely people out there who would rather learn the background of how a game works rather than using an engine.

just adding a “cool!” here because I don’t get the thread that is forming up there ^ :slight_smile:

open-sourcing this work is very nice for those learning game code, well done!

I appreciate the translation to a different conversation, was waiting for that :wink:

Thank you very much, I’m hoping that it’ll help those that are in game development!

I’d like to add to the change of conversation and say that the project looks great and well structured.

For contribution one can of course check the “issues” page for something to fix, but I think a list of features you’d like implemented would be nice too. Maybe this is the purpose of your “Being Worked On” section (which is pretty empty)?

Looks cool! Very nice of you to open-source this. How did you implement the lighting system?

Yes this is something that many people have asked for already so I will be filling in that section today!

When I was developing the lighting system I actually made a post asking for suggestions and I ended up modifying the algorithm that is found here. It is called a “recursive flood-fill” algorithm and it is the most efficient lighting algorithm that I could find to work with the game.

There were a few modifications that I made to it though. The algorithm worked great, but the way that it works means that it had to be called every single frame. When thinking about how to make the algorithm more efficient, I came to the conclusion that the lighting would only need to be updated when a light source is either placed or removed. So rather than calling the algorithm each frame, I called it once when either a light source is placed or removed and I save the value to a light map. The algorithm has become more complicated since then (you can check the LightUtils class), but the amount of resources that it’s saved is amazing.

I have to say I think this is great. I’ve recently got bored of my latest project, and have been scouring the web for any decent-looking mildy-active well-progressed open-source Java games, and this is the only one I’ve found that comes close, and Baseball should be applauded for open-sourcing it. I’m not sure I’ll be able to contribute much, but I look forward to having a play with it.