• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Development] Misc Side Project

Status
Not open for further replies.

Deleted member 177737

D

Deleted member 177737

Hey, it's been a while since I've been active on here. Over the past few months I've been learning Java as to take my Wc3 map making to a new level where I would be able to create my own games without limitations. :ogre_haosis:

So-far, after a lot of full code re-writes, I've managed to create a little program that loads a map of 10,000x10,000 pixels which is 100,000,000 40x40 pixel-tiles large when in-game, allows you to walk around the map with no lag, has perfect collision detection and has selective map rendering so that it only renders the area around the player.

There isn't too much to show other than these two pictures and a small demo where you can walk around an empty map of 1,000,000 tiles.


qjeTumP.jpg

z6jgxal.png



The main reason why I've decided to create a topic about the program here was to have a few people open up the program, walk around and then tell me about any bugs, lag, slow loading, etc... that they encountered.

The .jar has been attached below if you would like to try out the program.
 

Attachments

  • Test.zip
    5.5 MB · Views: 57
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Movement is strange. You can only move up, down, left and right with no diagonals. It also takes directions in a certain precedent so pressing up and down makes you go up instead of cancelling out to be neutral.

The window cannot be resized or played in full screen. It is taller than my desktop view area causing the bottom to be cut off while barely fills half the display width.

Movement is slow, very slow. It would take me many minutes to cross a 10,000 sized map.

There is no record of how the game is performing. It could be running at sub 60 fps for all I know.
 

Deleted member 177737

D

Deleted member 177737

Thank you for the criticism Dr, it's definitely better than if someone was to say any part was decent or good. I've already implemented an FPS counter and now I'm going to be working on resizing and possibly speed adjustments if I can figure them out.

I'm more-or-less a noob at programming so most of the code is a bit iffy, but I'm learning!
 

Deleted member 177737

D

Deleted member 177737

I've added in two strings that will show the amount of RAM being used (this is the amount of RAM, without the heap) and the FPS. It seems to be at a stable 60 FPS for me. The new version of the program has been uploaded onto the OP

After adding in the FPS/RAM display I attempted a few different 'quick fix' ways to get the code to allow for a resizable window; although certain parts worked, well at least a little bit, the whole program wouldn't accept resizing. It'll still be on my to-do list but I'm not too worried about resizing just yet, mainly because it would require the majority of the rendering code to be rewritten. The same goes for increasing the speed of the player.

The way I wrote the rendering code only works for one specific window size (1256, 998) at the moment but I'll hopefully get the time to rewrite the code soon. ^.^


Edit:
I just realized that the version of the program that has been attached to the OP is actually a lot older than I had previously thought. Most of the updates have been in the structure of the code and updates to a few switch and if-else statements, the only update that you may notice is that I there is an NPC walking around in a square of four waypoints, he's a little test for future NPCs and he'll probably look a bit buggy but that's only because I CnP'd a bit of the player's rendering code to render him.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Rendering the player should be the same as other actors as far as I can tell. You should be using the same shaders so there is no need to treat their graphs any differently. This is different from the background which needs to be rendered different.

The order that seems recommended is rendering the overlay objects first as this would allow culling of pixels for the background and terrain (saving render time). Even though this is not 3D you could probably use the same techniques z culling does to do this.
 

Deleted member 177737

D

Deleted member 177737

Time for a small update!

-Fixed two bugs with the movement code; it now works properly now.
-Added a temporary solid black interface to test where/how to render it on screen.
-Scrapped the NPC class and started on a rewrite. It's looking a lot cleaner now.

New version of the program is attached to the OP. My FPS is usually around 50-65 and the RAM stays around 22mb or so.
 

Deleted member 177737

D

Deleted member 177737

cool... btw, that char looks familiar... is that from the RPGMaker RTP?

Possibly; I just searched for a sprite sheet to use on google since I didn't have one.

Edit:
I've finally managed to get diagonal movement working perfectly. I was quite surprised when it only took me ten minutes, I guess rewriting most of the code multiple times made it easier for me in the end. ^.^ I'll upload a new version of the game whenever I get NPCs working.
 
Last edited by a moderator:

Deleted member 177737

D

Deleted member 177737

I've recently started to switch the project over to libGDX, a new jar has been uploaded.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
If resizing the window makes your rendering code misbehave, I fear to look at your code (not that I was going to).

Deciding what to render in a uniform tile map is as simple as this:
PHP:
x = worldX % tileSize;
y = worldY / tileSize;
w = screenWidth / tileSize;
h = screenHeight / tileSize;

In general, if you express all your sizes (positions, dimensions, etc.) in tile space rather than pixels, your life will seem brighter.
It's a simple scale when rendering to get it back to pixels for your screen.

The camera should most likely not go out of the map bounds.
 
Last edited:
Status
Not open for further replies.
Top