Giter VIP home page Giter VIP logo

lasttry's People

Contributors

alesod avatar col-e avatar egordorichev avatar leopoldek avatar logotie avatar nufflee avatar pascalharp avatar peterwathall avatar poixen avatar pollend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lasttry's Issues

Spawn system

1: Get user's biome

2: Get 'spawn rate' & 'max spawns' of biome.

3: calculate the spawnRate(Spawn Rate, Max Spawns)
{
1--- Check what events are active
If event has a hardcoded 'Max spawns', 'Spawn rate' & 'Monsters list' we call 'getTotalSpawnWeightOfActiveMonsters'

else
2--- Check time of day
Increase/decrease spawn rate

3 -- Check items in the environment
Increase/decrease spawn rate

4 -- then call getTotalSpawnWeightOfActiveMonsters

5 - then call '5'
}

function getTotalSpawnWeightOfActiveMonsters()
Calculate player spawn area.
Go through enemies and check if they are in player area.
Generate list of enemies in player area.
Calculate and return total spawn weight of monsters in player area.

4 -- Receives spawn rate, max spawns, spawn weight of active monsters.
If spawn weight of active monsters greater than max spawns - exit
else
calculate difference between max spawns and spawn weight of active monsters
based on the difference, we apply a multiplier to the spawn rate.
A lot of monsters already existing, we reduce spawn rate
Not a lot of monsters, we increase spawn rate

5 -- Gets a random number and compares to spawn rate, then returns true

6 -- SUCCESSFUL
--- Check if event is active and check if monsters exist for event.
else
--- Get list of eligible monsters based on Biome
--- Get coefficient from previous calculation.
--- Choose monster randomly
--- Call getValidCoOrdinates()
--- Pass co ordinates and monster, to spawn function.

function getValidCoOrdinates()
Returns valid co ordinates for spawning

7 -- Pass entity and co ordinates to 'spawn' function outside of class.

Can't load libraries (specifically luajava) on Windows

From the README.md

-Djava.library.path=lib/YOUR_SYSTEM-NAME_HERE (lookup the lib folder):lib/

With the vm args -Djava.library.path=lib/windows:lib/ the following occurs:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path

Removing :lib and using -Djava.library.path=lib/windows/ results in:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no luajava-1.1 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.keplerproject.luajava.LuaState.<clinit>(LuaState.java:86)

When the luajava-1.1.dll is dropped in the lib folder dependencies of the dll cannot be found:

Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Programming\Java\Terraria\LastTry\lib\windows\luajava-1.1.dll: Can't find dependent libraries
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.keplerproject.luajava.LuaState.<clinit>(LuaState.java:86)
	at org.keplerproject.luajava.LuaStateFactory.newLuaState(LuaStateFactory.java:59)

Any idea on what it's missing? The exception doesn't exactly state what is missing, rather just that something is missing.

This can be temporarily ignored by commenting out the lua field instantiation in LastTry.java's initStatesList method since the lua field isn't used anywhere else.

Name Validation

It shouldn't be possible to have a blank world name or player name.

It should probably check for weird non alphanumeric characters too.

Better movement API

Right now, we have only a few methods for the movement, such as:

  • move(direction) And this allows you only move right and left
  • fly(vx, vy) Also is not pretty

We need to change this API completely , also, implement A* path finding.

No main manifest atrribute

I have tried to build and run the project on both my Mac and Windows and have gotten the same errors on both computers. I followed the steps in the Readme and I can get "mvn package" to run. But after that I can't get anything to work.

target>java -jar lasttry-1.0.0-SNAPSHOT.jar
no main manifest attribute, in lasttry-1.0.0-SNAPSHOT.jar

I have tried several variations of this including being in the target folder, out of it and using an absolute path, quotes, even trying to run the main class using the jar as the classpath:

target>java -cp lasttry-1.0.0-SNAPSHOT.jar org.egordorichev.lasttry.LastTry
Error: Could not find or load main class org.egordorichev.lasttry.LastTry

The only warnings I get while running maven is that it's using platform encoding, could this be it?
Where is the main manifest? Or how do I get it to generate properly?

Assets distribution

Are you distributing assets from Terraria, because the note above the license makes it sound you does?

Player texture being cut off

The top of the texture isn't being rendered, it's like the player is in a box that is too small and anything outside the box is cut off.

I'm guessing there actually is a box somewhere in the code and that it's too small.

cut off

Multi-language support

All text is currently hardcoded to the game. Probably, we need a basic Language class, so we can easily change the game language. Something like this should work:

public class Language {
   public static void load(String locale) {

   }

   public static String dirt = "dirt".
}

And so on.

Multi-tile blocks

Some of the blocs, like furniture, workbenches and other working stations are more then 1x1 in size.
The engine must have support for multi-tile blocks.

asm-5.2.4.jar

I am adding maven dependency management to the project.
I see that you have asm-5.2.4.jar as a lib, though looking online the highest I can find is 5.2.
https://mvnrepository.com/artifact/org.ow2.asm/asm

The problem is that

<dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm</artifactId>
        <version>5.2</version>
</dependency>

Doesnt contain ClassAdapter:java.lang.NoClassDefFoundError: org/objectweb/asm/ClassAdapter

Where did you find this artifact?

todo

Moved todo list to trello: https://trello.com/b/X3o5KsSG/lasttry-development

  • Swing sword
  • Z-index for the blocks and entities
  • Main menu and World Loading states
  • Entity Manager
  • Move back the biomes
  • Player saves
  • Finish Tool class
  • Eye of Cthulhu (in progress)
  • Slopes
  • Spawn and spawn rate
  • Make player able to place blocks
  • Enemy drops
  • UI
  • Inventory
  • More blocks
  • World generation
  • Chests (must finish GUI first)
  • Multi Tile block find a way to store them in the world
  • Crimson and Corruption world property, also expert mode
  • Rotated hitboxes for sword and other items
  • Hit the player on touch and delay after hit
  • More tileable blocks Blocks should tile to dirt. And also, fix this:
    screenshot_2017-03-16_11-13-45
  • Update textures
  • Remove LuaMod
  • Build status
  • Lighting
  • Update movement methods so that any one can move up and down, while flying.
  • Multiplayer
  • World Time
  • Hardmode world property
  • Projectiles
  • Make the sand fall This requires projectiles
  • Save time to the world file

And more to come. Feel free to post more in comments.

Unable to load images and other assets.

I get the following crash when running the DesktopLauncher via gradle in IntellijIdea (Java SE 8u121)

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: splash.png
	at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:147)
	at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
	at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
	at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
	at org.egordorichev.lasttry.state.SplashState.<init>(SplashState.java:16)
	at org.egordorichev.lasttry.LastTry.create(LastTry.java:84)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: splash.png (Internal)
	at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
	at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:222)
	at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:144)
	... 7 more

Docs

@Col-E wants us to have docs. I think, that's a good idea. We have three ways of doing it:

  • Just docs in code
  • Javadoc on github pages (we need to sync it with auto builds on CI)
  • Extra markdown docs

I like the second way. The only thing is, that this will make our code pasta-looking. As the "Clean Code" book tells, javadoc is not always good.

Any thoughts?

Find a better way to store enemies info

Right now we have this code:

public static Enemy create(int id) {
		switch(id) {
			case EnemyID.none:
			default:
				return null;
			case EnemyID.greenSlime:
				return new GreenSlime();
			case EnemyID.blueSlime:
				return new BlueSlime();
			case EnemyID.eyeOfCthulhu:
				return new EyeOfCthulhu();
		}
}

And if we want to add more enemies, we must update this list. But this is not the best way to do that. For example, if some wants to add custom enemy from mod, he will be not able to do that.

Font class missing

The build is failing because org.egordorichev.lasttry.graphics.Fonts no longer exists

Move to LibGDX texture manager

I did a bit of research on this theme, and it turns, that it is better to use build in gdx assets manager,
then the way, we do that now. Will move to it today.

Script for porting terraria tiles

In our project we use different texture packing method, and while I was adding evil block,
I hated process of moving texture path so much!

We need to make a script, that will do this automatically.

Game crashes when clicking specific inventory boxes

When you click on any of the boxes to the right of the main inventory the game crashes giving this error

Exception in thread "LWJGL Application" java.lang.NullPointerException at org.egordorichev.lasttry.ui.UiItemSlot.canHold(UiItemSlot.java:165) at org.egordorichev.lasttry.ui.UiItemSlot.onStateChange(UiItemSlot.java:196) at org.egordorichev.lasttry.ui.UiComponent.update(UiComponent.java:153) at org.egordorichev.lasttry.ui.UiComponent.render(UiComponent.java:44) at org.egordorichev.lasttry.ui.UiItemSlot.render(UiItemSlot.java:82) at org.egordorichev.lasttry.ui.UiInventory.render(UiInventory.java:237) at org.egordorichev.lasttry.ui.UiManager.render(UiManager.java:11) at org.egordorichev.lasttry.state.GamePlayState.render(GamePlayState.java:118) at com.badlogic.gdx.Game.render(Game.java:46) at org.egordorichev.lasttry.LastTry.render(LastTry.java:166) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)

Crafting

This system is one of the core mechanics. Recepies will be stored in json. The only hard thing is ui. If we will make something simular to terraria, this will also require scrollable ui.

Porting to LibGDX

Slick2d is no longer in the development. We must move to LibGDX. Staring to port code on the libgdx branch.

Drawing both blocks and walls slows my FPS

This fragment in TileData.java is very strange:

		if (wall != null) {
			wall.renderWall(this, x, y);
		}
		if (block != null) {
			block.renderBlock(this, x, y);
		}

If I run it and using the Ghost mode and go down into the earth a bit, my FPS drops. To 30.
But if I replace it with this code:

		if (wall != null) {
			wall.renderWall(this, x, y);
			wall.renderWall(this, x, y);
		}

or even with this:

		if (block != null) {
			block.renderBlock(this, x, y);
			block.renderBlock(this, x, y);
		}

All works fine. What is the catch?

Java doc and java code style

@Col-E, I see, that my java doc style is not perfect (in fact, it is first time I use it a lot). So can you figure out the code style and java doc style for the project. Is this a good style?

        /**
	 * Handles window resize
	 * @param width new window width
	 * @param height new window height
	 */
	@Override
	public void resize(int width, int height) {
		super.resize(width, height);

		viewport.update(width, height);
		camera.update();
	}

Chunk with changes can be reset

I was building a test ground for something and all of a sudden the terrain to reset to what it had looked like when I loaded up the game.

Bundle with language not found

Just returned from a trip, pulled and run the new source:

LastTry had crashed!
-------------------
LastTry had stopped running, because it encountered a problem.

Please, copy and report the entire text to email [email protected] or
submit an issue https://github.com/egordorichev/LastTry/issues


--- BEGIN ERROR REPORT ---
LastTry version: v.0.3
OS: Linux (amd64) version 3.18.9-gentoo
Java version: 1.8.0_72, Oracle Corporation
Java VM version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Java VM flags: 0 total; 
Memory: 222811528 bytes (212 MB) / 243269632 bytes (232 MB) up to 3596091392 bytes (3429 MB)
Exception cause: java.util.MissingResourceException: Can't find bundle for base name language, locale en_US
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
	at org.egordorichev.lasttry.language.Language.load(Language.java:10)
	at org.egordorichev.lasttry.LastTry.create(LastTry.java:106)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
--- END ERROR REPORT ---

Something with language is missing.

Biomes

We should star thinking about biomes.

  • How do we store them? (Maybe, static instances).
  • How do we figure out, in witch biome player is?
  • Add spawn rate, include boss event in it (when boss spawns, other enemies must not spawn).
  • How fast we need react to biome change?

Broken hair

The player's hair flickers, appearing and disappearing regularly as you walk along the ground. But this doesn't happen while moving through the air, it only happens during the walking animation.

On the main branch the hair was sometimes moving towards the player's feet too so I removed this line from org.egordorichev.lasttry.entity.player.PlayerRenderer:

pixmap.drawPixmap(hair, 0, 748);

and it stopped happening, I have no idea what that line was for but removing it didn't seem to break anything.

Lighting

Addition of Lighting to LastTry.

Lighting from sources, such as torches and Sun.

Liquids

This can be an interesting thing to play around. Each empty block can have liquid level and liquid type (water, lava, honey). Liquids shouldx be drawn on top of all entities. Physics part shouldn't bed hard to implement: just compare neighbors every 0.5 - 1 second. Also, liquids should slow down entities.

Please, add this to trello.

Block slopes and solid top things

Many blocks in the future, should work as platforms. This is called solid top blocks.
Also, thing to add is block slopes. We hae to variants of doing them:

  • Only terraria-included ones.
  • Top option + top corners, left slope, right slope and top-half slope.

Second one is not so good, because you will have to many variants, to hammer through.

Better README

Just now the README.md is completely unuseful. We need to fix that. New structure:

  • LARGE Screenshot or logo
  • Description
  • Goals
  • Installation
  • Contributing
  • License (optional, maybe just a link to the file)

Maven + Jar files?

Now that maven is being used, are the .jar files in /lib still required?

Infinite jumping

If you hold jump with a block above you, it lets you hover there forever. You can abuse this to basically fly upwards.

It's actually quite a fun bug so you might not want to remove it.

flying

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.