Jump to content

  • Log In with Google      Sign In   
  • Create Account

TreeSaaaaap

Member Since 24 Feb 2014
Offline Last Active Sep 12 2014 12:34 PM

Topics I've Started

How to transition into Game Dev with Java

01 July 2014 - 03:44 PM

Hi guys,

 

I've been working in Java for a little while now (after learning some Python and C++) and I'm feeling more comfortable with Java syntax more than the other languages so far.

 

I'm looking for a resource that will help me to better understand (in-depth) how to actually render terrain and models, and at some point help me understand the process of doing this with a client/server connection.  I find some decent articles and reading out there, but these things still confuse me.

 

I realize that it's a bit advanced, but it is something I could work towards as a hobby.  I'd love to create a multiplayer game similar to Ultima Online.  But if I could figure out how to render a map like that (isometric and terrain/tiles?) and have it work as a multiplayer game I'd be extremely happy.  Did UO use a heightmap, large bitmap, or just render a huge map of small tiles right next to each other?

 

Also, would you guys suggest trying the jmonkeyengine?

 

Lastly, this might be a dumb question but how is gear rendered both on a player, and in a paperdoll with the ability to die a section of armor?  Graphics programming seems extremely difficult.

 

What would you guys suggest as a decent resource for transitioning from basic Java to understanding some graphics and server/client programming?

 

Thanks!


Vectors Newb

26 February 2014 - 02:58 PM

Hi, 

 

I'm trying to learn Python and program an RPG (perhaps transitioning into a multiplayer RPG someday - once I have a better understanding of what I'm doing!)  I've enjoyed tinkering around in C++ over the years, but I still consider myself a big time newb.  I learned most of the Python syntax already however, and I'm enjoying it thus far.  Also, I've picked up Pygame to help me write this game.

 

My question is about vectors.  I'm not exactly a math genius (and some of you may say to just drop programming now), but I really want to learn...

 

Basically, I want to move the player object to the location of a mouse click (similar to that in Diablo, UO, etc) whatever angle it might be.  Very simply, I want to move the player object from the objects current coordinates to the mouse click position coordinates.  I've scratched my head for many hours already trying to figure out exactly how to do it.  

 

I can't understand if it's the vector itself I need, or the magnitude, direction, velocity, angle etc.  I just want to move (2,0) to (33,33) arriving smoothly at each x and y coordinate, etc.  Perhaps, I'm doing this all the wrong way.

 

Anyone know of a better resource that might help me understand this a little better/easier?  

 

Thanks!

 

 


Python (pygame) Slow Blit?

24 February 2014 - 05:38 PM

Hello Everyone, 

 

This is my first post here, but I plan on spending a lot of time here trying to learn (and help others).

 

I've dabbled in c++ off and on for the last few years, but I found myself struggling to find a project that wasn't too challenging (or too easy) and I stepped away for a bit.

 

Recently, I started teaching myself a bit about Python.  Apparently, it's a simpler language (that can do a lot) and I figure I'll give it a shot, maybe I can accomplish something.  So I set out the other day and now I'm here...

 

I've attempted to render a background image (or terrain) with another image on top that can move to the location of a mouse click.  I'm having trouble understanding why the image won't move precisely when I click, every time. For instance, if I click in quick succession, the image may only change locations once every second or more.

 

I have a feeling like it has something to do with constantly having to redraw the images, perhaps slowing it down?  If that's the case, I wouldn't understand why because I thought that the game loop would iterate many times a second.... Or maybe my loop isn't working right?  Can I just "move" an image instead of the constant "blit-ing"?  If not, then this kind of concerns me with what I plan on doing in the future.  (When I click a point on the terrain, I want to move, or walk, the image to that point).

 

Obviously, this is a very simple task, especially for some of you, but I can't really tell if it's a problem with the way I'm coding it or if it's really how slow python/pygame is?

 

Here is the code:


import sys, pygame

pygame.init()

SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 800
BLACK = (0, 0, 0)

screen = pygame.display.set_mode([SCREEN_WIDTH, SCREEN_HEIGHT])
pygame.display.set_caption("TTB")
screen.fill(BLACK)

#set cursor here somewhere

terrain = pygame.image.load("terrain.jpg")
terrainRect = terrain.get_rect()
terrain = pygame.transform.scale(terrain, (SCREEN_WIDTH, SCREEN_HEIGHT))
screen.blit(terrain, terrainRect)

oPC = pygame.image.load("amishdude.png")
oPC = pygame.transform.scale(oPC, (75, 75))                                     
oPCrect = oPC.get_rect()
screen.blit(oPC, oPCrect)

pygame.display.flip()

running = True #initialize the main game loop

while running == True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False #break loop and close 
        

    for event in pygame.event.get():
        if event.type == pygame.MOUSEBUTTONDOWN:
                mouseRect = pygame.mouse.get_pos()              
                screen.fill(BLACK)
                screen.blit(terrain, terrainRect)
                screen.blit(oPC, mouseRect)
                pygame.display.update()
                
                
  

pygame.quit()
#sys.exit()


PARTNERS