Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (814)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3
1  Discussions / Miscellaneous Topics / Re: Annoying Interview Q on: 2017-04-24 12:49:29
Depends how you interpret the question, because of course you can go through the tools which are required, but in my opinion it was not the goal of the question. I think more on project suitability for CI tools, and in my opinion for CI to be able to do its job, it requires the application to have significant test coverage (since CI tools main purpose is to prevent integration problems) and properly configured build system environment (with database migration tools, release management, etc). Additionally, I would probably speak about the agile environment, since when the builds are failing you require someone to take care of them and generally agile teams devote some % of for maintenance and are ready to jump in almost at any time to solve the problem.
2  Game Development / Game Mechanics / Re: Diablo 2 / Old School Runescape client/server theory. on: 2017-04-07 11:29:15
I am not very experienced (I have made some multiplayer games but they never went live actually), but I might share my opinion and observations with you:
1) Path calculation. Since I have been long time RS player (not very active though) I have seen multiple decisions made by their team. Initially from what I suspect the calculation was client side and it actually allowed to use mouse-less clients (or packet base clients) which would allow you to send to the server the coordinates you wanted, the server might have been doing some simple verifications to detect speed hacks and moving through obstacles, but at the end it was client who was taking care of path calculation. At some point (I cannot really remember the dates), the path calculation moved either completely to server or it was partially validated, since there was some delay from the moment you click to the moment your character starts moving. I believe that at the currently, all the critical logic is being calculated by the server, the client is what the name suggests is displaying what the server have calculated. Similar problem happened with rare items duping still in classic version of RS, where the client had some power in terms of decision in trade windows. Now, those are only guesses. Now there are drawbacks of moving logic to the server which is the load you create on the server machine. What I believe could be potentially good solution is what actually is happening in Web development is still let the client calculate, but validate occasionally. Save the point A and point B and the path client has provided (or even some hash) and make the calculation on the server with determined frequency. Paths not matching would mean that user might be cheating and you can suspend the account. Leave all non critical operations to be done by client by validate the user actions from time to time.

2) For followers you can re-use the calculated path, be aware though that game state can change (e.g the door can be closed or open), so at some point you might need to check the path availability if you know that the object on the time can change state in terms of open for passage or closed for passage. For NPCs which attack your heroes(e.g have different starting point), you might need to do the calculations on the server, since you want all the clients to see the NPC on the same position while it is moving.

3) For wandering NPCs you can have zone limitation with randomized short moving paths, so you do not need to go deep with your calculation or even randomized on walkable tiles only. Pre-defined path is only good in some cases, when the guy is patrolling some street for example, otherwise the behavior might not look natural.

Once again, I do not have much experience there, it is pure my opinion on the topic.
3  Game Development / Newbie & Debugging Questions / Re: Libgdx detecting the click on game unit on: 2017-03-02 21:41:58
Good point, both should be very similar in performance. I could have game units with rectangular hitbox, but not the projectiles (since they can rotate, the arrow rotation depends on the trajectory point, but also they cannot be "user selected").
4  Game Development / Newbie & Debugging Questions / Libgdx detecting the click on game unit on: 2017-03-02 20:54:47
Hey, I have got a question about click detection on game units. On the following screen you can see the hitbox of the archer (the  cyan colored circle).



I believe it is too big to be considered as successful hit when user clicks it with the mouse. So I am thinking of three possible solutions:
1) Leave it as it is. Even I don't like it is one of the possible solutions
+ Lightweight and super simple
- Very inaccurate
2) Use several smaller circles for archer hitbox instead.
+ Still kind of Lightweight and simple
- Might be a bit inaccurate
3) Use Pixmap. I believe creating Pixmap every time I would need to check detect a click, so I would need to initialize it in the beginning and play around the initial version.
+ Very accurate
- More memory required to represent the gfx
- Much more complex in comparison to previous solutions.

Would like to know your thoughts and maybe some tips of how you do it in your games.
Thanks, ww.
5  Game Development / Newbie & Debugging Questions / Re: Learning LWJGL on: 2017-03-02 15:13:18
Cheerz, I really like this one: https://lwjglgamedev.gitbooks.io/3d-game-development-with-lwjgl/content/
6  Discussions / Miscellaneous Topics / Re: Programming in schools - opinions? on: 2017-02-23 16:03:15
I my vision the school should be more like a vine fair. You go there you taste a bit of everything and then you choose what you actually like and what you are going to purchase. I agree that it might not be very beneficial for those people who's traits are not exactly good for engineering to be forced to be one. At some point it might also not be bad to give some introduction to programming, but later, when the logical thinking starts forming (reminded me this)

7  Game Development / Newbie & Debugging Questions / Re: Sprite render order using libgx tiled maps on: 2017-02-17 08:58:04
One idea could be creating "next iteration" list (which still will render in the same rendering phase). While iterating over you main list, you check the z of the object and if it is not the current level, you place it in the "next iteration" list. When finished with current list, you start by drawing tiles from "next iteration" list (if needed you can perform the checks and build yet another "next iteration" list). You can think about it in the way that you reuse exiting list initialization (in order to reduce the amount of objects for GC to dispose). The main advantage in terms of the most simple solution (which would be iterating the initial tile list over and over again) is the amount of iterations you might need to do, since if you have just few bridges, the "next iteration" list will have very few components.
8  Java Game APIs & Engines / Tools Discussion / Texture manipulation lib (normal and dudv maps generation) on: 2016-07-25 14:11:55
Cheerz,

I would like to introduce the small port (the credits to original author are provided on the page) to Java I have finished recently, which would allow you to create normal and dudv maps without the recurrence to 3rd part software, you can do it directly from your code. I made this port, since I could not find any Java implementation.

https://github.com/serhiy/texture-manipulation

To include the lib in you Maven project you could use https://jitpack.io/:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
<dependency>
    <groupId>com.github.serhiy</groupId>
    <artifactId>texture-manipulation</artifactId>
    <version>0.0.1</version>
</dependency>

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>


The result of applying the filters in correct order should look like:


How it works?
There are few examples on the GitHub, but you pass the BufferedImage to the convert function of appropriate class and receive a new BufferedImage which can be either height (or simply greyscale), normal or dudv map.

Why(and where) it is useful?
In my case for example I am automatically generating normal and dudv when adding the texture to my texture atlas (in the tool I am building). Of course you can use more sophisticated tools for doing that, but when it is automatic it costs you less time ofc.

Feel free to give feedback. I might consider adding new features if requested and I find the algorithms for that in the Web.
9  Game Development / Shared Code / Re: Hydro's Game Engine on: 2016-06-23 10:58:02
Not really sure about why people jumped on you for trying to demonstrate something game-related... I still think that the final purpose of the game development for majority of the community is still the fun.. You are having fun, that is the most important.. And the argument about "wheel reinvention" is the most pathetic argument you can hear to prevent you from having fun.. Remember, there are banks, hotels, restaurants, malls, cafeterias, etc providing you exactly the same service, everyday of your life, but somehow no one still realized that those have "reinvented the wheel" and still profiting.

I might have some time to give it a shot in the evening to give you some feedback, keep doing what makes you happy! May the Force be with you!
10  Game Development / Newbie & Debugging Questions / Re: LibGDX problem detecting the mouse click on mesh triangles on: 2015-10-29 14:33:52
Just to make sure that if someones runs into the same problem, the solution is described below (very stupid bug in my code Cheesy)

The Vertex Shader, in order to determine the position of the vertices, was performing
1  
a_position * u_projectionViewMatrix
multiplication, which was resulting on what was looking fine on the screen, but actually when you compare with actual coordinates of the mesh it was wrong. Now if you check the examples at https://github.com/libgdx/libgdx/wiki/Shaders, you can see, that
1  
gl_Position
is being calculated by multiplying
1  
u_projectionViewMatrix * a_position

Making the correct calculation made the trick.

I also had to change the camera to perspective, since the mesh was not rendered how I wanted it to.
11  Game Development / Newbie & Debugging Questions / Re: LibGDX problem detecting the mouse click on mesh triangles on: 2015-10-27 08:00:08
I have added question to SO(http://stackoverflow.com/questions/33362529/libgdx-incorrectly-detecting-the-mouse-click-on-mesh-triangles), maybe someone visiting SO (but not this forum) has an idea what am I doing wrong

Besides that I have done some drawings and the coordinates reported both by ray source and target, projected to near and far plane(obtained from camera frustrum) does not seem to hit the mesh (in the second scenario, when I click to the red area, rather than mesh). I will model it in Blender, just to make sure that the drawings I have done are correct.. In that case I will need to understand what is not being taken into account and how to solve it.
12  Game Development / Newbie & Debugging Questions / LibGDX problem detecting the mouse click on mesh triangles on: 2015-10-23 10:54:31
Hello,

I have been trying to add mouse click detection on the triangles of the mesh, but it seems that I am doing something wrong and I cannot figure out how to solve the problem.

So before explaining the problem I will define the environment(the full code is available at http://pastebin.java-gaming.org/a6e9e2e8d351b):
- Camera position
1  
2  
3  
4  
5  
cam = new OrthographicCamera(10, 9);
cam.position.set(0, 5.35f, 2f);
cam.lookAt(0, 0, 0);
cam.near = 0.5f;
cam.far = 12f;

- Mesh renders 4 vertices.
1  
2  
3  
4  
5  
6  
7  
mesh = new Mesh(true, NUM_COLUMNS * NUM_LINES, (NUM_COLUMNS * 6 - 6) * (NUM_LINES - 1), VertexAttribute.Position(), VertexAttribute.ColorUnpacked());
mesh.setVertices(new float[] {
    0, 0, 0, 0, 1, 0, 1,
    1, 0, 0, 0, 1, 0, 1,
    0, 0, 1, 0, 1, 0, 1,
    1, 0, 1, 0, 1, 0, 1 });
mesh.setIndices(new short[] { 2, 0, 1, 2, 3, 1 });


So when I run the application I try to check if the click was done inside some of the triangles of the mesh. Now the result depends on the position of the camera. When the camera has almost top view(like in the following picture), corresponding to around 6 on Y axes, the click point is being correctly translated to the coordinates and corresponds to what is actually being seen.


When I move camera on the Y axes to lower position (around 2 or 3), so the image looks like the following one
the click is being detected in the completely wrong positions (the red line shows the place where the click is detected).. Which seems to be right according to the coordinates, but not according to what is being seen..

I would like to understand what an I missing to be able to detect clicks on what actually is being seen? The code I use to detect the click is the following:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
@Override
   public boolean touchDown(int screenX, int screenY, int pointer, int button) {
      Ray ray = cam.getPickRay(screenX, screenY);
      Vector3 intersection = new Vector3();
      float[] v = new float[NUM_COLUMNS * NUM_LINES * VERTEX_SIZE];
      short[] i = new short[(NUM_COLUMNS * 6 - 6) * (NUM_LINES - 1)];
      mesh.getIndices(i);
      if (Intersector.intersectRayTriangles(ray, mesh.getVertices(v), i,
            VERTEX_SIZE, intersection)) {
         System.out.println(intersection);
      }
      return false;
   }


Thanks a lot for your help!
13  Game Development / Shared Code / Re: Simple "console like" chat on: 2011-03-01 00:28:05
You could post some code of you chat, so every could have benefit from using it.
14  Game Development / Shared Code / Re: Simple "console like" chat on: 2011-02-28 10:04:15
I have tried to work with StyledDocument.. I could get it showing correctly different colour line(different colors in the same line). That was the main reason why I started to work with HTML. Another thing, does Styled document will allow to be extended to show emotes and for example links to items?
15  Game Development / Networking & Multiplayer / Re: broadcast on lan? on: 2011-02-27 23:59:19
There are specific mechanisms for broadcasting Wink

Check this article: http://www.oser.org/~hp/ds/node27.html
16  Game Development / Shared Code / Simple "console like" chat on: 2011-02-27 23:49:05
Hello,

I want to share with you some code which I have recently finished, which gives respect to the game chat GUI. For the game I'm making, I needed some component, which would allow coloured text, content appending and removing when some limit of lines is reached and some scroll behaviour, which I'll post after I will implement it Wink.

The chat has following aspect


So, as main container of the content I have chosen JTextPane, since it allows HTML(which make possible full personalization of the text, including colour, text styles and much more). But there were several problems and challenges to solve, like appending and removing the text because JTextPane doesn't have such options.

I'm using the following code for creation of the JTextPane, note that there should be set HTMLEditorKit and HTMLDocument to the JTextPane, else HTML will not be rendered(thanks for people from StackOverflow helping me solve this issue)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
this.text_panel = new JTextPane();
this.text_panel.setContentType("text/html");
this.text_panel.setEditable(false);
this.text_panel.setBackground(this.text_background_color);
this.text_panel_html_kit = new HTMLEditorKit();this.text_panel.setEditorKit(text_panel_html_kit);
this.text_panel.setDocument(new HTMLDocument());

scroll_pane = new JScrollPane(this.text_panel);
scroll_pane.setBounds(5,5,580,110);
scroll_pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scroll_pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
this.add(scroll_pane);


The next step was creating the append function. You will need to work directly with the HTMLDocument set to the JTextPane in previous step. My append function looks like:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public void append(String line){
   SimpleDateFormat date_format = new SimpleDateFormat("HH:mm:ss");
   Date date = new Date();
     
   line = "<div><font size=3 color=GRAY>[" + date_format.format(date) + "]</font><font size=3 color=BLACK>"+ line + "</font></div>";
     
   try {
      this.text_panel_html_kit.insertHTML((HTMLDocument) this.text_panel.getDocument(), this.text_panel.getDocument().getLength(), line, 0, 0, null);
   } catch (Exception e) {
      e.printStackTrace();
   }
}


The next step is creating line limit and remove the lines from the start which pass the limit. For this step I have used LimitLinesDocumentListener taken from http://tips4java.wordpress.com/2008/10/15/limit-lines-in-document/ (read on the blog about how it's being used). Though I needed to do some changes in the removeLines function(which in my case will not use functions removeFromStart and removeFromEnd. And now it's looks like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
private void removeLines(DocumentEvent e)
{
   Document document = e.getDocument();

   try {
      while (((HTMLDocument) document).getText(0, document.getLength()).split("\\n").length > maximumLines)
      {
         int end = document.getText(0, document.getLength()).split("\\n")[0].length();
           
         document.remove(0, end+1);
      }
   } catch (BadLocationException e1) {
      e1.printStackTrace();
   }
}


The last step is adding the listener to the text_panel, this is done with following code:

1  
2  
LimitLinesDocumentListener limitLinesListener = new LimitLinesDocumentListener(Configuration.getInstance().CHAT_VISIBLE_LINES);
this.text_panel.getDocument().addDocumentListener(limitLinesListener);


And before finishing note, there was also added some scroll behaviour, which makes the scroll jump to the last inserted item, achieved with following code:

1  
2  
DefaultCaret caret = (DefaultCaret)text_panel.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);


I hope this will help some1 and save some time implementing nice chat(console) with colours and appending/removing. If you will find some optimization issues in my code or some things which can be simplified I will be very thankful if you report them in this topic or via pm.

Thanks for attention Wink
17  Game Development / Game Mechanics / Re: Enhancing game engine with scripting capabilities on: 2011-02-24 19:37:42
Hey

I'm not too familiar with Groovy, but I am familiar with Jython.  May I ask why do you think Groovy is more attractive that Jython?  One advantage of Jython that I can think of is that Python is very popular among the developer community and if you use Jython, you can leverage a lot of existing developer resources that may or may not exist with Groovy.

One the first things that come in favour of Groovy is it's "proximity" to Java(including syntax), integration seems to be much easier then with Jython, at least this is what I read in some forum posts. I'm aware that Python is more stable and balanced. I have some experience with Python(I have already made Tetris game), but I really prefer Java, just a question of personal preference.

Regarding the actual mechanism in embedding a interpreter into your engine, what I found is that once you have a scripting engine, the possibilities are limitless in terms of what you can do with external scripts vs. what you can do in your codebase.   As long as you pass the relevant objects to your scripts, the scripts can take over the entire execution of your game if you like. 

I already have imagined that potential of scripts is very high, but in large games it's probably very hard to keep the codebase at the minimum, architecture must be planned very carefully and with several "heads"(people) (though this applies almost to all projects)

Thanks for you help and very demonstrative example. Bookmarked for future study Tongue
18  Game Development / Game Mechanics / Enhancing game engine with scripting capabilities on: 2011-02-24 14:24:18
Hello experts Smiley

Maybe few of you remember me with my half-fail(or probably full-fail) game which I released like half year ago(or more). I have learned a lot from making it and was regaining forces during half year to start everything from scratch. Sorry for off top, going now directly to the questions.

I have started making new game engine and I want to enhance it with scripting capabilities. I want be able to use scripting on the map(for now adding new NPCs, objects and items, some map events) and NPC AI programming. I have already read some documentation of Groovy and Jyton, most likely to use Groovy, it appeared to me more attractive, unless some of you could give me advice using any other scripting language. This was the first question.. The second question which I have is about embedding the script. The way I'm thinking to do this for the map for example is:
i) I create the map object with some tiles
ii) In separate file I create the script, which will have access to the map object, granted by embed mechanisms in my server code
iii) I place the script file only on the server and when some event occur I send the data to the client

Do I think correctly? Can you correct me and point the right way of doing this?
Thank you in advance,
ww
19  Discussions / Miscellaneous Topics / Re: I'm Married on: 2010-06-25 08:56:23
Gratz!!! Best wishes!

I'm also planing to marry in 2 month Smiley
20  Game Development / Newbie & Debugging Questions / Re: Initialising threads with a while loop. on: 2010-06-23 14:03:42
Initializing the Thread with same name in this case won't cause problems because of using new Thread(), which will create new instance of the object(in this case Thread), overwriting the old one.

What about Vector, I think(almost 100% sure) that after the death of the thread you will need to remove it from Vector, else Vector will keep growing in it's size.
21  Game Development / Newbie & Debugging Questions / Re: Initialising threads with a while loop. on: 2010-06-23 13:40:27
Hmm if you won't name the Thread you can have memory leaks in your soft, cuz some of the threads could not finish for some reason.. Also if you gonna create the threads and don't save reference to it, you are loosing control over the threads you created.

I'm not sure of the best solution for this, but I would use something like:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Vector <Thread> particle_thread_vector = new Vector <Thread>();
...
while(true)//put your condition here
{
...
Thread tmp_thread = new Thread(new ParticleAI());
tmp_thread.start();
particle_thread_vector.addElement(tmp_thread);
...
}
22  Discussions / General Discussions / Re: Project Natal on: 2010-06-15 13:34:50
The project it self is very promising. But I think this promotional video overestimate for sure the current state of the project. This is like what happened 2 or 3 weeks ago on the company I work. The television guys came and made some reportage about the new technology which is being worked in the company, but as I was core tester of the project and I have seen the video they made and shown on television I said like: "WTF?". 40-50% of what they said was lies.. And overestimation of what was currently done.. I think the video is kinda proof of concept and not what they actually have. At least this is my opinion(I might be very wrong).
23  Game Development / Performance Tuning / Re: This is killing my computer D: (simple task) on: 2010-06-11 11:38:31
Last time I checked, even single core CPUs could do context-switching Wink

True, have tried now putting 5 infinite cycles running and still getting machine response, though it's kinda slow, but anyway, better then restart Cheesy. But I know for sure, infinite cycle with forks(C) would kill machine in 10 seconds Tongue (not applies to the case, but anyways Tongue)
24  Games Center / Archived Projects / Re: Stickmen Wars #2 feasibility test on: 2010-06-11 08:52:25
Nice! I got it running 10-11 fps in "Quite Mode" on my PC(so probably it doesn't count a lot), going to try in "Gaming" or "Performance" mode when going to be at home.. PC makes too much noise Cheesy

But it's really nice work!
25  Game Development / Performance Tuning / Re: This is killing my computer D: (simple task) on: 2010-06-10 14:46:59
Make the Thread sleep for 25msec for example or read some tutorials about how wait() and notify() works in Java Threads.. Before starting make something it's better to read some documentation before..

EDIT: The code you have is has infinite cycle... probably your PC has 2+ core CPU, this is what saving you from complete freeze of machine...

EDIT2: This question should go to "Newless Clubies" section Wink
26  Game Development / Newbie & Debugging Questions / Re: Thread stopping. on: 2010-06-09 16:21:42

Omg this one is extensive, but probably I'll give it a look Cheesy (interesting)
27  Game Development / Networking & Multiplayer / Re: About UDP on: 2010-06-09 16:19:17
yeah, but how is that string read, by the rechiever? How do you seperate the things?

Check this out Wink
http://sites.google.com/site/gson/gson-user-guide
28  Discussions / Jobs and Resumes / Re: Java MMORPG Project - Looking for a team! on: 2010-06-09 16:16:39
I bet you mean 'offline'.

Hmm, I mean people from university, who are kinda lazy and then there is overhead of working for entire group.. It's hard to find some1 addicted and some1 who would really help without making a lot of stupid questions.
29  Discussions / Jobs and Resumes / Re: Java MMORPG Project - Looking for a team! on: 2010-06-09 11:30:56
riven's got a point, its ok if you know them in rl, but online they will flake out

Well even online it's hard to motivate people to write the things in your rhytm... Or even write anything...
30  Game Development / Networking & Multiplayer / Re: About UDP on: 2010-06-09 11:15:55
So how excactly do I check the code for the protocol to know what to do? .startsWith("") ?

I'm not sure about if the JSON I'm positing is esthetically right, since the applications I made previously all used XML and after figuring out the problems using of XML I only planning to investigate how to pass that to JSON and how correct JSON is being created, but the string could look like:
1  
2  
3  
4  
5  
6  
{
    "request": "upd_pos",
    "character_id": 1,
    "line": 10,
    "column": 10
}

Using GSON(library of Google that allows JSON) parsing you get every element of the JSON and you can parse the type of request which arrived depending on the "request" element.
Pages: [1] 2 3
 
cybrmynd (139 views)
2017-08-02 12:28:51

cybrmynd (160 views)
2017-08-02 12:19:43

cybrmynd (154 views)
2017-08-02 12:18:09

Sralse (170 views)
2017-07-25 17:13:48

Archive (649 views)
2017-04-27 17:45:51

buddyBro (768 views)
2017-04-05 03:38:00

CopyableCougar4 (1302 views)
2017-03-24 15:39:42

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

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

Rule (1313 views)
2017-03-19 12:42:17
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!