Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (715)
Games in Android Showcase (214)
games submitted by our members
Games in WIP (788)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 3 4 [5] 6 7 ... 10
 41 
 on: 2017-03-26 21:40:09 
Started by TGStudiosDE - Last post by VaTTeRGeR
You could use some simplified xml/json-esque hierarchial format to define meshes, entities, map structures and world settings all in one file.
The format valve uses for their map editor is a good example of this:

-> *.vmf format

That wiki page contains a lot of examples and explanations.

All you do is represent all ingame objects as structured text/binary(->serialization) data.
1  
2  
3  
4  
5  
6  
7  
8  
//text
model {
    id 13
    file "unit/soldier.md5"
    pos {
       0.0, 1.2, 1.992
    }
}


How you do it is up to you, but using a single bitmap is not feasible for a true 3d game (gameplay in 3d, not only 3d graphics).

 42 
 on: 2017-03-26 20:16:52 
Started by Coding17 - Last post by basil_
http://www.songho.ca/

https://processing.org/

 43 
 on: 2017-03-26 19:54:39 
Started by DrHalfway - Last post by basil_
exactly, i dont know if it's possible. .. or how good a shared gl context would work on mobile.

anyway. instead of glReadPixels you could try glGetTexImage/glGetTextureImage and deal with the textures instead of color_attachments.

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexImage.xhtml

https://www.khronos.org/opengl/wiki/Pixel_Buffer_Object#Downloads


 44 
 on: 2017-03-26 19:41:30 
Started by ral0r2 - Last post by KaiHH
The two conditions:
Quote
The player could be on four tiles at the same time as well.
and:
Quote
There is no diagonally movement in my game.
Do not match up; or are rather contradictory and unenforceable, because the first condition implies that a player can change direction of movement (horizontally or vertically) at any time, also during movement between any two tiles. Otherwise he would not be able to be on parts of four tiles at the same time, but only between two tiles (if the player first completes the horizontal or vertical transition between any two tiles before beginning the next movement).
If the player can in fact change direction of movement at any point in time, then the second condition cannot be enforced, because a player could alter direction between horizontal and vertical movement very fast making it look like he is moving diagonally.
At least that's how it sounds to me.

You should probably first describe in greater detail and very explicitly what your gameplay/logic is, how it affects routing decisions, which movement should be possible and when it should be possible and whether there is movement that is not integral to routing/gameplay but only for the purpose of animation and possibly collision detection. Probably write some concept document for that, first, and try to think about every possible case.

So, depending on whether the transition between any two tiles is purely for animation and collision detection or is also an integral part of routing decisions, you should separate between the position of a player with respect to animation, and the position of the player with respect to routing. If a player will always begin and complete a full movement/transition between any two adjacent tiles, then you only need float positions for animation and collision detection and otherwise can solely use integer coordinates for routing/gameplay.

 45 
 on: 2017-03-26 18:52:04 
Started by BurntPizza - Last post by 65K
Happily received a new in-game GIF for Lethal Running:

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

 46 
 on: 2017-03-26 18:29:22 
Started by ral0r2 - Last post by ral0r2
Thanks for your replies guys.

The player could be on four tiles at the same time as well.

I think this is a good approach KaiHH, I'm just struggeling a little bit with how I could use this in my code.
There is no diagonally movement in my game. And as I already said all entities have floats as X & Y.

Would that mean to declare a new variable which relates the entity to a specific tile?
Because right now there is no attribute in my game which tells an entity at which tile it is.

Or would that mean to round my float positions (X/Y) to ints?



 47 
 on: 2017-03-26 17:08:27 
Started by bullen - Last post by Cero
Don't.

 48 
 on: 2017-03-26 10:26:34 
Started by TGStudiosDE - Last post by TGStudiosDE
At the moment I just load an image read every pixel and I have defined RGB colors in the image and when I have some defined color I put the defined Mesh at the place for it.Just so:

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  
public boolean loadLevel(String path)
   {
      BufferedImage img = null;
     
      try {
         img = ImageIO.read(Level.class.getResourceAsStream(path));
      } catch (IOException e) {
         e.printStackTrace();
      }
     
      this.w = img.getWidth();
      this.d = img.getHeight();
     
      for(int i = 0; i < img.getWidth(); i++) {
         for(int j = 0; j < img.getHeight(); j++) {
            Color c = new Color(img.getRGB(i, j));
           
            if(c.getRed() == 255 && c.getGreen() == 255 && c.getBlue() == 255)
            {
               entities.add(new Entity(texturedModel, new Vector3f(i, -2, -j), 0, 0, 0, 1));
               entities.add(new Entity(texturedModel, new Vector3f(i, 2, -j), 0, 0, 0, 1));
            }
           
            if(c.getRed() == 85 && c.getGreen() == 85 && c.getBlue() == 85)
            {
               entities.add(new Entity(texturedModel, new Vector3f(i, -2, -j), 0, 0, 0, 1));
               entities.add(new Entity(texturedModel, new Vector3f(i, -1, -j), 0, 0, 0, 1));
               entities.add(new Entity(texturedModel, new Vector3f(i, 0, -j), 0, 0, 0, 1));
               entities.add(new Entity(texturedModel, new Vector3f(i, 1, -j), 0, 0, 0, 1));
               entities.add(new Entity(texturedModel, new Vector3f(i, 2, -j), 0, 0, 0, 1));
            }
           
            if(c.getRed() == 255 && c.getGreen() == 0 && c.getBlue() == 0)
            {
               entities.add(new Entity(texturedModel, new Vector3f(i, -2, -j), 0, 0, 0, 1));
               entities.add(new Entity(texturedModel, new Vector3f(i, 2, -j), 0, 0, 0, 1));
            }
         }
      }
     
      return true;
   }


I don't understand your method that much but I want to build Levels like you in your FPS Engine for example Smiley

 49 
 on: 2017-03-26 03:29:26 
Started by orange451 - Last post by Drenius
@KaiHH: True. From the wording I assumed there were just exactly two seperate uses of it but I see now that it was indeed not necessarily implied.

 50 
 on: 2017-03-26 01:34:50 
Started by CopyableCougar4 - Last post by CopyableCougar4
Nevermind, I solved my problem: I had to use another import method.

1  
2  
3  
4  
5  
      int flags = Assimp.aiProcess_Triangulate | Assimp.aiProcess_GenNormals | Assimp.aiProcess_ImproveCacheLocality
            | Assimp.aiProcess_SortByPType | Assimp.aiProcess_OptimizeMeshes | Assimp.aiProcess_OptimizeGraph
            | Assimp.aiProcess_CalcTangentSpace | Assimp.aiProcess_TransformUVCoords | Assimp.aiProcess_GenUVCoords
            | Assimp.aiProcess_JoinIdenticalVertices | Assimp.aiProcess_FlipUVs;
      AIScene scene = Assimp.aiImportFileEx(asset.getPath(), flags, null);

Pages: 1 ... 3 4 [5] 6 7 ... 10
 
CopyableCougar4 (187 views)
2017-03-24 15:39:42

theagentd (169 views)
2017-03-24 15:32:08

Rule (226 views)
2017-03-19 12:43:22

Rule (211 views)
2017-03-19 12:42:17

Rule (216 views)
2017-03-19 12:36:21

theagentd (234 views)
2017-03-16 05:07:07

theagentd (231 views)
2017-03-15 22:37:06

theagentd (171 views)
2017-03-15 22:32:18

theagentd (165 views)
2017-03-15 22:31:11

ral0r2 (163 views)
2017-03-03 11:52:41
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!