Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (799)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (865)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  CaveGear  (Read 20767 times)
0 Members and 1 Guest are viewing this topic.
Offline Dev Crucio

Senior Devvie


Medals: 9
Projects: 1
Exp: 9 years


CaveGear


« Posted 2015-06-15 20:06:41 »



So this is my first Project on here, it's called CaveGear Smiley

It's a mixture of Minecraft, Terraria, Starbound and Magicite, so basically a 2D Sidescroll Sandbox game with the Goal to survive. Enemies will have much more HP than the Players, potions will be very rare and there is no Health Regen at all. You'll start off with 3 Hearts and the amount can only be increased by Weapons/Armor with Vitality as a stat. There are other Stats such as Dextertity (Increasing accuracy of your Bow) Strength (Increases your Sword's damage) Inteligence (Increases Magic damage) and Defense (Decreases Damage taken).

Story:
You (and your friends, multiplayer is fully implemented) crashed with your Spaceship on a planet without oxygen, your Ship is completly destroyed and you don't have the technology to fix it. The only working parts you could get out of the wreck are an Oxygen Compressor and a Crafting Station. each of you has an Oxygen Flask that holds air for only one minute equipped and that's about all you have. You quickly realise that you don't have any chance of getting away from this planet, so you decided to build a base and explore the planet which surprises you with magical weapons, strange ores and deadly creatures.

Features:
✔ - Day Night Cycle
✔ - Build and Break blocks
✔ - Lighting (Reimplementing)
✔ - Multiplayer
✔ - Menu
✔ - Inventory System
✔ - Infinite Terrain generation
✔ - Seed depending maps with Caves
✔ - Player Animations
✔ - Ingame Chat

Todo:
✘ - Crafting System
✘ - Monsters
✘ - Liquids
✘ - More Ores/Stonetypes/Materials
✘ - Bosses
✘ - Health, Oxygen, Mana and Hunger bars
✘ - Character Customization
✘ - Stat system on weapons

(After Implementing and Testing some more Stuff I'll release a Demo)

And now some Videos about the current look of the game:

Animated Menu:
<a href="http://www.youtube.com/v/lyN4Rb6sZ7Q?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/lyN4Rb6sZ7Q?version=3&amp;hl=en_US&amp;start=</a>

Day-Night Cycle:
<a href="http://www.youtube.com/v/XodplMMKgvc?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/XodplMMKgvc?version=3&amp;hl=en_US&amp;start=</a>

Build/Break and Inventory:
<a href="http://www.youtube.com/v/CXLHClXaQHs?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/CXLHClXaQHs?version=3&amp;hl=en_US&amp;start=</a>

Twitch - See me developing CaveGear Smiley
Offline TritonDreyja
« Reply #1 - Posted 2015-06-15 20:52:09 »

Amazing work my friend, impressive.
Definitely will be following this project.

Cheers Crucio!
Offline Dev Crucio

Senior Devvie


Medals: 9
Projects: 1
Exp: 9 years


CaveGear


« Reply #2 - Posted 2015-06-18 20:07:43 »

Ingame Chat added Smiley shows up to 7 messages currently

Day/Night Cycle improved, Sun and Moon now show up in the back, and some clouds passing by Cheesy

+ I switched from Intermediate Mode rendering to VBO rendering (only in the chunks), from 30 FPS to 1300  Cool
have to reimplement the light next (so it shows above entities, it makes no sense that entities are always in their true color)

Twitch - See me developing CaveGear Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TritonDreyja
« Reply #3 - Posted 2015-06-24 03:04:00 »

Does this game have a story or is it prominently a sandbox
Offline Hanksha
« Reply #4 - Posted 2015-06-24 04:22:36 »

Are you using VAO as well?

Offline Dev Crucio

Senior Devvie


Medals: 9
Projects: 1
Exp: 9 years


CaveGear


« Reply #5 - Posted 2015-06-24 05:26:09 »

I'm currently using VBOs for the Chunks and Intermediate Mode for everything else (will change that)

There's a Story in the main post here that will introduce to the game, like why your character is there etc. but other than the atm not, I'll be working on that later i guess

Twitch - See me developing CaveGear Smiley
Offline Hanksha
« Reply #6 - Posted 2015-06-24 06:00:02 »

You should use VAO, you can bind your VBOs to it (like vertices, colors, texture coords...).
When you render you just have to bind the VAO, enable the attribs and then retrieve them in your shader program.

Offline PlainBug
« Reply #7 - Posted 2015-06-24 06:31:53 »

How long did it take you to develop this version?  Smiley

Offline Riven
Administrator

« JGO Overlord »


Medals: 1370
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #8 - Posted 2015-06-24 07:25:37 »

You should use VAO, you can bind your VBOs to it (like vertices, colors, texture coords...).
When you render you just have to bind the VAO, enable the attribs and then retrieve them in your shader program.
Keep in mind though that VAOs are still slower than doing it the 'inefficient' way. Most games, for this reason, simply have 1 VAO and bind their VBOs like they did prior to the existence of VAOs. It's simply not the driver's fast path.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline Dev Crucio

Senior Devvie


Medals: 9
Projects: 1
Exp: 9 years


CaveGear


« Reply #9 - Posted 2015-06-24 08:08:18 »

actually i started it like 10 days ago, but I've recoded it a multiple times before, copied some stuff froom there and restarted.

are VAO faster than VBOs? Tongue

Twitch - See me developing CaveGear Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hanksha
« Reply #10 - Posted 2015-06-24 08:22:27 »

Keep in mind though that VAOs are still slower than doing it the 'inefficient' way. Most games, for this reason, simply have 1 VAO and bind their VBOs like they did prior to the existence of VAOs. It's simply not the driver's fast path.
I just think VAO to be convenient, and since he's rendering chunks of tiles that applies.

Offline Dev Crucio

Senior Devvie


Medals: 9
Projects: 1
Exp: 9 years


CaveGear


« Reply #11 - Posted 2015-06-24 12:06:00 »

I'm currently Stuck with the lighting that is determined by the day time, updating the VBOs that are affected all at once freezes the screen visibly for under 1 second :/

Twitch - See me developing CaveGear Smiley
Offline Hanksha
« Reply #12 - Posted 2015-06-24 12:48:27 »

Show your code maybe we can help you with that  Smiley

Offline Dev Crucio

Senior Devvie


Medals: 9
Projects: 1
Exp: 9 years


CaveGear


« Reply #13 - Posted 2015-06-24 14:18:15 »

Code for Block Place and Break:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
// Blockchange
   public void change(World world, int x, int y) {
      float finalLight = 0;
      for (int ix = -1; ix <= 1; ix++) {
         for (int iy = -1; iy <= 1; iy++) {
            float dis = ix * ix + iy * iy;
            if (dis != 0) {
               float cur = 0;
               if (world.getBlock(x + ix, y + iy) != null) {
                  cur = world.getBlock(x + ix, y + iy).light;
               }
               if (dis == 2) {
                  cur -= 1.7f;
               } else {
                  cur -= 1.0f;
               }
               if (opaque) {
                  cur -= 1;
               }
               if (cur < 0)
                  cur = 0;
               if (cur > finalLight) {
                  finalLight = cur;
               }
            }
         }
      }
      if (finalLight != light) {
         light = finalLight;
         stepChange(world, x, y);
         if (Chunk.stepping)
            chunk.redolight = true;
      }
   }

Code for the method "Step Change"
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
   public void stepChange(World world, int x, int y) {
      if (world.getBlock(x - 1, y) != null)
         world.getBlock(x - 1, y).change(world, x - 1, y);
      if (world.getBlock(x, y - 1) != null)
         world.getBlock(x, y - 1).change(world, x, y - 1);
      if (world.getBlock(x + 1, y) != null)
         world.getBlock(x + 1, y).change(world, x + 1, y);
      if (world.getBlock(x, y + 1) != null)
         world.getBlock(x, y + 1).change(world, x, y + 1);
   }


And in the BlockAir it's different cause that's the only one affected by the WorldLight:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
@Override
      public void updateWorldLight(float delta, World world, int x, int y) {
         BlockBack bb = world.getBlockBack(x, y);
         if (bb == null) {
   
         } else if (bb.Type == 0) {
                  change(world, x, y);
         }
      }
   
      // Blockchange
      @Override
      public void change(World world, int x, int y) {
         boolean worldLight = true;
         float finalLight = 0;
         BlockBack bb = world.getBlockBack(x, y);
         if (bb == null) {
   
         } else if (bb.Type == 0) {
            if (world.worldLight != light) {
               finalLight = world.worldLight;
               worldLight = true;
            }
         }
         for (int ix = -1; ix <= 1; ix++) {
            for (int iy = -1; iy <= 1; iy++) {
               float dis = ix * ix + iy * iy;
               if (dis != 0) {
                  float cur = 0;
                  if (world.getBlock(x + ix, y + iy) != null) {
                     cur = world.getBlock(x + ix, y + iy).light;
                  }
                  // following calculations round the light shape
                  if (dis == 2) {
                     cur -= 1.7f;
                  } else {
                     cur -= 1.0f;
                  }
                  if (opaque) {
                     cur -= 1;
                  }
                  if (cur < 0)
                     cur = 0;
                  if (cur > finalLight) {
                     finalLight = cur;
                     worldLight = false;
                  }
               }
            }
         }
         if (finalLight != light) {
            light = finalLight;
            if (worldLight) {
               if (shouldChange(world, x, y)) {
                  stepChange(world, x, y);
                  if (Chunk.stepping)
                     chunk.redolight = true;
               }
            } else {
               stepChange(world, x, y);
               if (Chunk.stepping)
                  chunk.redolight = true;
            }
         }
      }
   
      public boolean shouldChange(World world, int x, int y) {
         for (int ix = -1; ix <= 1; ix++) {
            for (int iy = -1; iy <= 1; iy++) {
               float dis = ix * ix + iy * iy;
               if (dis != 0) {
                  if (world.getBlock(x + ix, y + iy) != null) {
                     if (world.getBlock(x + ix, y + iy).Type != 0) {
                        return true;
                     } else {
                        if (world.getBlockBack(x + ix, y + iy) != null) {
                           if (world.getBlockBack(x + ix, y + iy).Type != 0) {
                              return true;
                           }
                        } else {
                           return true;
                        }
                     }
                  }
               }
            }
         }
         return false;
      }


If the chunk.redoLight has its value set to true it will refresh the VBO rendered for the light.
the update worldlight method only gets called when the WorldLight value changes.
I'm stuck :p

I don't think that's quite readable but well :/

Twitch - See me developing CaveGear Smiley
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (208 views)
2019-09-04 15:33:17

hadezbladez (4948 views)
2018-11-16 13:46:03

hadezbladez (1824 views)
2018-11-16 13:41:33

hadezbladez (5225 views)
2018-11-16 13:35:35

hadezbladez (1032 views)
2018-11-16 13:32:03

EgonOlsen (4416 views)
2018-06-10 19:43:48

EgonOlsen (5249 views)
2018-06-10 19:43:44

EgonOlsen (2988 views)
2018-06-10 19:43:20

DesertCoockie (3882 views)
2018-05-13 18:23:11

nelsongames (4314 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!