Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  "NXBG" Hexagon-Multiplayer-Tactic-Game  (Read 3295 times)
0 Members and 1 Guest are viewing this topic.
Offline ennix
« Posted 2014-03-10 22:15:36 »



VIDEO:
<a href="http://www.youtube.com/v/oq-LycuXuSA?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/oq-LycuXuSA?version=3&amp;hl=en_US&amp;start=</a>

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

Hi there.
First, excuse my bad english (im a german coder).

As you can see in the video, im working on a multiplayer strategy/tactic game with my favourite tileset: HEXAGONS (one of my first played games was battle isle).

At the moment players are able to move (wasd) around the map.
Collision detection and jumps on/from blocks are working.
Multiplayer part (tested with up to 15 players) is working too.
Mapeditor (ugly, but only for me) is usable.

Next:
- I have to create new Player-Models (as you can see, i used model & skins from minecraft).
- Damage (via mouse-hovered fields on the ground)
- Include "fractions" (there will be 3 fractions on every map, fighting each other, building structures)
*** edit: i ment "factions" (thanks quew8 for correcting me) ***

next multiplayer-test-session: sunday, 16.03.2014 18:30 -> 19:30 (link will follow)

be the hexagon
Offline quew8

JGO Coder


Medals: 31



« Reply #1 - Posted 2014-03-10 23:13:47 »

Looks very pretty (I like hexagons too). The lighting is very pleasant to look at but somehow I don't think it's actually lighting at all. At least not the conventional phong/specular etc. And I love how it took me several minutes to realize that random hexagonal columns aren't natural formations. To me it gives the ambiance of an extremely playful game. I hope you'll keep that aesthetic.

I'm curious as to whether you're going to go for hexagon based players? I'm thinking of meshes made completely of hexagons. Might be really cool. Probably be super ugly. I'm no artist so I can't quite imagine it. Maybe partially comprised of hexagon at least? Damn, you got me babbling about hexagons now.

So what does NXBG stand for? Would that be German for "Hexagon-Multiplayer-Tactic-Game?" Because if so you might want to think up a snazzier title too? Something about hexagons I'd guess.

Also in your post you wrote "fractions" whereas I think you mean "factions." A fraction is that mathematical thing with a numerator and denominator. Like 1 / 2. A faction is a group of like-minded individuals working towards the same goals. Like NOD & GDI in CnC Tib Wars.

The above and the fact that there is no playable demo for me to indulge myself in are the only qualms I have so far.

Edit: Sorry I got a bit carried away there.
Offline ennix
« Reply #2 - Posted 2014-03-10 23:42:07 »

thank you for your answer and suggestions.
you are right: i ment "factions" - in german its "fraktion", there the "r" is coming from  Roll Eyes  - im sorry

the light isnt a real light - thats right  Cool
im going through the webGL-interface to change the "vertice-colors" of every face of the terrainobjects (hexagon-columns).
so the "flat" bottom hexagons on top of every column are made of 6 faces with 3 vertices per face. every vertice could have a colour, that "overlaps" (does this word exists  Huh) the basic-texture.
so im calculating nearby hexagons and change the color of every vertice on every face on every hexagon, depending of the fields nearby.
this is done once at start. so i manage 60FPS (this time, more objects will follow and eat performance  persecutioncomplex).

if you have questions, please ask.
i need this resonance, it holds my motivation up  Cheesy



the name "NXBG" is just a working title - "nx" is my nickname in games, as dj and as coder :-) (nx comes from ennix - long story...)
im searching for a good title. but there is much time to do this.


be the hexagon
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline StrideColossus
« Reply #3 - Posted 2014-03-11 11:30:32 »

Looks really good.
Am interested to see what you have in mind for building structures and how they affect the game.
Keep up the good work Smiley
Offline ennix
« Reply #4 - Posted 2014-03-11 11:56:23 »

Hi, and thanks for your answer / question!

i wanted to wait with more infos, cause im not sure if all these ideas find into the final version. but here are more details:

There will be a huge world (lets call it a lobby with graphic interface) with different maps (different biomes. snow, lava, desert, isles, ...).

static structures:
on every map are structures/locations like: "sentry", "supply-camp", "bridge", "tower", "fort" up to big castles.
all these locations have "claim-spots". a small sentry has one claimspot. the big castle has 5 or more claimspots.
if players of one faction stays inside this (simultaneous in all spots of one location), the claimspot will slowly raise to 100% (if all players are alife and out of fight inside the spots  Grin)
then this location changes the owner to the claiming faction. now the new owner can upgrade this location.
possibilitys like: make the sentry stronger, upgrade claimspots to need more time to complete claim, produce more supplys at a supplycamp, ...
all this upgrades needs supplys from supply-camps... u know what i mean  Cool

dynamic structures:
at many spots on a map, players can build barricades between 2 high "columns" to make it easier to defend some towers or the castle...

all this differs from map to map.
there are small maps, where 5-10 players can get a lot of points for there faction.
and big maps, where (i hope) "zergs" of 40 and more players are fighting the same time Shocked

i have a lot of detailed features in my head  Cool

at the moment i work at the combat-system.
i would say, i have a flow.
give me 2-3 days, i will upload new pics and video.
maybe i can give out a link to test the game.

at this sunday 16.03.2014 between 18:30 and 19:30 i turn on the server to make another multiplayer-test.
you are welcome :-)

there is a lot of work to do :-)
its a one-man project  persecutioncomplex


i added 3 more screenshots.
as you can see, there is the first attempt of including combat-system (on the lower left  persecutioncomplex)
and i used different views to show the possibilyties of this engine.
every field (hexagon) has values for cameraHight, cameraDistance, cameraLookAt to use for different locations (inside castle, dungeon, canyons...)






be the hexagon
Offline Drenius
« Reply #5 - Posted 2014-03-11 15:27:24 »

This looks interesting...
Offline VIrtueeL
« Reply #6 - Posted 2014-03-11 18:31:59 »

[trolly]
this would be so mutch better with boxes =D.....  if you get it [obs] not meant to offend you


[real]
this is cool really cool cus i cant even create a 3d box in java 3d XD

i do devlogs and i do tutorials check em out
https://www.youtube.com/user/InidDevo
Offline saucymeatman
« Reply #7 - Posted 2014-03-11 19:02:45 »

ennix : appoligizes for bad english, and then speaks almost perfectly.
VIrtueel : native speaker, impossible to understand.
Online Jimmt
« League of Dukes »

JGO Kernel


Medals: 136
Projects: 4
Exp: 3 years



« Reply #8 - Posted 2014-03-11 22:46:57 »

ennix : appoligizes for bad english, and then speaks almost perfectly.
VIrtueel : native speaker, impossible to understand.
Keep it on topic, please.
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #9 - Posted 2014-03-13 01:12:21 »

Good looking stuff.  I like using hex-tiles too.

Couple of questions:
  • How are you doing your hit-testing?
  • What scheme are you using for your hex-coordinates?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ennix
« Reply #10 - Posted 2014-03-13 06:10:03 »

thanks for your questions.

first the hit-testing answer:

there are two types of render-objects:
- fixed objects (only terrain, with precalculated shadows using vertex-coloring the faces), this is merged as one big object to improve performance.
- dynamic objects (player, portal-objects, obstacles like barricades), these are all separately added to the scene.
- a mixture of both for the "hover-hexa", the hexagon-texture (6 faces) on the top of every hexa-column. this is the important object to get the position for all actions.

i check all the intersected objects by using a raycast from mouse-pos to the 3D-scene, after i converted this to 2D.
so i know at which dynamic object my mouse-cursor points.
if it points on an "hover-hexa" i can get the x/y pos of the 2D hovered position in the 3D world.
(i assigned names "xPos/yPos" to every hover-hexa when i first render the map).

now to your question:
i dont check the detailed position of all players.
every player has a hexagon-position (x/y) on the map. as i know the hover-hexa-x/y position of my mouse, i know which player(s) i can hit.
now the "trick". i dont use single player-shots in the game.
all positive actions (healing, speedup, stealth, strengthUp, ...) and negative actions (poison, slowDown, fireCondition, ...) are actions only on the hover-hexas.
so the players "throw" fields with actions on the hover-hexas.
every player who is in this action-field is affected by it...

ever action has values for duration, intensity,... so players can stack this actions at one field.
this prefers group-players: one throws chains to constrain players, the other one throws his upskilled fire-damage field on the victim :-)
(btw: every player can only take 8 different actions in his action-slots to use in combat. but can change this actions at his base)

i hope, i have explained it understandable :-)

****
second question (hex-coordinates):
on my first attempts i used axial-coordinates. but after many hours/days of testing different situations i decided to use offset-coordinates.
its much easier to store (not that huge array-overhead), and the little workarounds (usually mod-functions) are good to handle.
btw: this site ist great when using hexagons: http://www.redblobgames.com/grids/hexagons/

i wrote some little helper-functions to get the adjacent hexagons. so the new shadow-calculations (improved since the last screenshots) are easier to handle.

new Video (this time with free cam-mode - for editing), better shadows, new textures and first use of the new mapmaker (png-heightmap to database plus fine tuning via ingame-editor):
<a href="http://www.youtube.com/v/wjiJhYAEwGM?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/wjiJhYAEwGM?version=3&amp;hl=en_US&amp;start=</a>


be the hexagon
Offline ennix
« Reply #11 - Posted 2014-03-15 09:21:16 »

i'm proud to announce, that many new features have found there way into the game.

- when starting the game (just open the link in browser), you will be assigned to 1 of 3 factions and spawn in the right base
- you can use 5 different actions (lavafountain, healpuddle, chains, fireball and speedup) by "throwing" it on fields below other players
- these actions will affect depending on there values friendly or enemy-players
- some (ugly) bars for showing values like health, move-points, attack-points (and 2 other types mana+support)
- finally i improved the map with some cool terrain structures like caves, hills and lakes


i will tweak the performance, so we can do the testsession tomorrow with ~20 players (i hope)
server is online from 18:30 till 19:30, no download needed. runs in browser.

greets!

be the hexagon
Offline ennix
« Reply #12 - Posted 2014-03-16 17:16:42 »

wow.

thanks for testing. this was fun!

i got dozens of ideas (and bug-reports).

next test will follow.
now i have to sleep.
cu

be the hexagon
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #13 - Posted 2014-03-16 19:26:16 »

there are two types of render-objects:
- fixed objects (only terrain, with precalculated shadows using vertex-coloring the faces), this is merged as one big object to improve performance.
- dynamic objects (player, portal-objects, obstacles like barricades), these are all separately added to the scene.
- a mixture of both for the "hover-hexa", the hexagon-texture (6 faces) on the top of every hexa-column. this is the important object to get the position for all actions.

i check all the intersected objects by using a raycast from mouse-pos to the 3D-scene, after i converted this to 2D.
so i know at which dynamic object my mouse-cursor points.
if it points on an "hover-hexa" i can get the x/y pos of the 2D hovered position in the 3D world.
(i assigned names "xPos/yPos" to every hover-hexa when i first render the map).

Interesting.  I followed a similar path as well: separating the terrain features from more dynamic features.  How do you efficiently hit-test the hover-hexas though?  In my implementation (400x400 hexes) I used an oct-tree with axis-aligned bounding boxes for the fixed terrain.  I then ray-cast as you do.  As for the dynamic entities I still iterate over each and every one but I figure that I won't have more than a couple hundred on screen max.  I thought about your tip of tying a dynamic entity to a hover-hexa but it doesn't account for smooth animation transition and/or flying.

Quote
all positive actions (healing, speedup, stealth, strengthUp, ...) and negative actions (poison, slowDown, fireCondition, ...) are actions only on the hover-hexas.
so the players "throw" fields with actions on the hover-hexas.
every player who is in this action-field is affected by it...

ever action has values for duration, intensity,... so players can stack this actions at one field.

Do you apply radius as well e.g. an AoE could affect 1 tile (radius 1) or 7 tiles (radius 2)?

Quote
second question (hex-coordinates):
on my first attempts i used axial-coordinates. but after many hours/days of testing different situations i decided to use offset-coordinates.
its much easier to store (not that huge array-overhead), and the little workarounds (usually mod-functions) are good to handle.
btw: this site ist great when using hexagons: http://www.redblobgames.com/grids/hexagons/

Interesting, I'm using his axial-coordinates (see code comment below).  Calculating distance is really straight-forward.  Can you expand a little more why you found it troublesome?  I had no trouble with distance, hit-testing, and A* path finding.  Was wondering about storage though because the diagonal offset is awkward for rectangular maps.

Thank for pointing to Amit's site.  He's really improved it since I looked at it a few years ago.

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  
A hexagonal tile grid is actually a projection of cubes onto the plane where
x+y+z=1.  Representing a coordinate in 3-axis (each 120 degrees apart) has a
few benefits.  For example distance calculations are much simpler.

I choose to orientate the hexes with a vertex on top.  If I wanted to display
an English word using tiles then it would be horizontal.

Absolute hex coordinate: i,j,k



               / \     / \     / \     / \
k axis        /   \   /   \   /   \   /   \         i axis
             /     \ /     \ /     \ /     \
    \       |       |       |       |       |        /
      \     | 0,-2,2| 1,-2,1| 2,-2,0|3,-2,-1|      /
        \   |       |       |       |       |    /
           / \     / \     / \     / \     / \
          /   \   /   \   /   \   /   \   /   \
         /     \ /     \ /     \ /     \ /     \
        |       |       |       |       |       |
        |-1,-1,2| 0,-1,1| 1,-1,0|2,-1,-1|3,-1,-2|
        |       |       |       |       |       |
       / \     / \     / \     / \     / \     / \
      /   \   /   \   /   \   /   \   /   \   /   \
     /     \ /     \ /     \ /     \ /     \ /     \
    |       |       |       |       |       |       |
    |-2,0,2 |-1,0,1 | 0,0,0 | 1,0,-1| 2,0,-2| 3,0,-3|
    |       |       |       |       |       |       |
     \     / \     / \     / \     / \     / \     /
      \   /   \   /   \   /   \   /   \   /   \   /
       \ /     \ /     \ /     \ /     \ /     \ /
        |       |       |       |       |       |
        |-2,1,1 |-1,1,0 | 0,1,-1| 1,1,-2| 2,1,-3|
        |       |       |       |       |       |
       / \     / \     / \     / \     / \     / \
      /   \   /   \   /   \   /   \   /   \   /   \
           \ /     \ /     \ /     \ /     \ /     \
            |       |       |       |       |       |
            |-2,2,0 |-1,2,-1| 0,2,-2| 1,2,-3| 2,2,-4|
            |       |       |       |       |       |


                        |
                        |
                        |

                      j axis



Note that the i and j axis mimic screen coordinates.

For painting purposes doubles may be used to interpolate between tiles and
in these circumstances, the coordinates are fi,fj.

Distances or relative positions on the horizontal plane are denoted by
di,dj,dk.

To convert to/from cartesian coordinates (see Displayed.java):
x = w * sqrt(3) * (i + j/2)    (note x can also be calculated from k)
y = w * (3/2) * j

where w = length of hex edge
Offline ennix
« Reply #14 - Posted 2014-03-17 04:56:28 »

hi,

thanks for your reply and questions.

after the online-test yesterday i figured out, that the moves from hex to hex are just a little bit too jerky and imprecise.
we played with 5-10 people and had some cool fights. but rotating in 60 degree steps is hard for players eyes when playing more than 10 minutes...

the system with throwing actions below the players is cool and works very fine. but players could escape too fast from this affected hexagon.

another problem is the performance when more than 1000 dynamic objects are at one map at the same time... like you figured out too.

i will discard the mouse-hover-hexa-system and try another way:
throwing actions (bottles with poison, fire, healthpotions, stealth-potions, slowdowns, ...) could be done by aiming with mouse an click & hold to set throw-power = distance.
by calculating velocity+gravity (and some other factors) i know the position where it explodes on the map^^ maybe it could be hard to calculate cause of ostacles...
but this offers some new cool possibilities: players could use heavy cannons or other immobile weapons to defend towers/castles...
i will try and tell the results  Grin

about your questions applying radius of effects:
yes, every action has its distance and a radius of affected hexagons.
but because of my failure, that the hexagons are too big (this time), the difference between radius 1 and 2 is much too hard.

with my next engine-try (this week), i will use smaller hexagons to get better aoe-results. but now i have to discard the hover-hexas, cause they are dynamic-objects...
another big step will be this change: i discard the moving from hex-center to hex-center and try a pixel-accurate moving over hexagons. this will cause heavy-brain-pain because of a harder collision-detection,
but i will give it a try  Shocked
my first idea to solve this is: i just check collision like circle vs circle :-) player is a circle, and the smaller hexagons too   Roll Eyes
i will try and post my results.


about the hex-coordinate-system:
when using offset-coordinates, the important thing is the right using of some mod-functions. if you mastered this, it will be like easy x/y rectangle coordinates.
dont underrate the problem with the storage of your map. especially when using chunks on bigger maps.
and distance-calculations with offset-maps is easy like hell :-) same as getting neighbor-hexas...
by playing with small hexagon-samples - amit is right on his page to use the axial-system - i tried all the ways and i finally arrived at the offset-system :-)
i will use this. u can use any other system  Smiley

well, its time to start an improved engine-try.
people wait for next test on sunday 23.3.  Grin

greets from germany

if someone is interested in some short-term online-tests or other developing things and big progress-jumps feel free to send me an email: *marcel at nxserver.de*
i will invite you for next tests. no worrys about spam - i dont have the time to write many emails  Cool



be the hexagon
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #15 - Posted 2014-03-17 07:58:57 »

Thanks for the response, I love talking hexes!

Quote
another problem is the performance when more than 1000 dynamic objects are at one map at the same time... like you figured out too.

The hover hexes can be static.  What I did is that I stored the center point of each hover hex.  Then I constructed an oct-tree in normal 3D space.  From here a hit test occurs if the ray is within a certain distance of the point.  Of course this isn't pixel exact (testing a circle rather than a hex) but in my experience it's close enough.

Quote
but because of my failure, that the hexagons are too big (this time), the difference between radius 1 and 2 is much too hard.

Hrmm... can't you just move the camera farther away?   Grin  There might have to be larger differences in height to compensate.

As for radius 1 (1 hex), 2 (7 hexes), 3 (19 hexes) it definitely is an interesting problem coming up with a good AoE gradient.

I'll fire off an email to you.  Definitely interested in testing your game.
Offline ennix
« Reply #16 - Posted 2014-03-18 04:11:49 »

hi.

you pointed to an interesting idea with the distance-system.
i played around the last 24h  persecutioncomplex and got a good solution to increase performance and get a very good feeling when throwing actions below other players.
i will work hard the next days and present the new version.

thank you loom_weaver!

also your second idea to move the camera farther away is as simple as brilliant... i think programmers often lose sight of the wood for the trees  Roll Eyes

i will keep you inform about progress.


the last engine-version suggested 2 and more layers to move on. but there was only 1 ground-layer with different heights and another above, but not to go on.
with the new hexa-engine-version i will try to add gravity and (quasi) infinite layers, so players can walk above and below other players  Stare
i will give it a try

be the hexagon
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (53 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!