• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
zodaz

2d game lagging.

10 posts in this topic

So, i'm making a 2d rpg tile scrolling game in java, everything went smooth until about a week ago. The rendering area in the game is based on the player coords, when the player moves, the rendering area moves. About a week ago everything "scrolled" perfectly smooth, but  now the scrolling "lags". The rendering area moves like 1 pixel back and forth very quickly for about 3 sec, then for 0.5 sec it's very smooth. I've searched my code for a week to try and find any rendering issues, but nothing found. Then i played realm of the mad god and i saw the exact same thing there(never been there before), is there something wrong with my computer?, what should i do?, has anyone else experienced this? My pc is not too slow, the game is running @ 4800fps.

Edited by zodaz
0

Share this post


Link to post
Share on other sites
Off the top of my head I would say it's not Java related in the sense that Java needs to be reinstalled, since rotmg is created in flash. I would probably try to reinstall the graphics drivers, maybe something went wrong during an update.

Edit:
If this doesn't work, maybe you should make sure that you are clearing the memory in the game so that you don't just continuously allocate more and more memory just because u aren't flushing/clearing ur graphics after each redraw or something like that.

Otherwise I think we need more information, when exactly did it start, what's the difference between the code when it worked and the week that didn't work etc. What did you add? Without this it's extremely difficult to give an accurate answer.
2

Share this post


Link to post
Share on other sites

Off the top of my head I would say it's not Java related in the sense that Java needs to be reinstalled, since rotmg is created in flash. I would probably try to reinstall the graphics drivers, maybe something went wrong during an update.

Edit:
If this doesn't work, maybe you should make sure that you are clearing the memory in the game so that you don't just continuously allocate more and more memory just because u aren't flushing/clearing ur graphics after each redraw or something like that.

Otherwise I think we need more information, when exactly did it start, what's the difference between the code when it worked and the week that didn't work etc. What did you add? Without this it's extremely difficult to give an accurate answer.

Tried to reinstall drivers, didn't work, i'm clearing memory, and never seen any fps drops. It worked fine before i implemented online multiplayer i think, but i have backups from before that and they lag the same way now, so i don't think it's the code, none of my friends i tested multiplayer experienced any lag. So i think it's my computer, i've installed some random games lately, might try to remove some..

 

Edit: Didn't work.

Edited by zodaz
0

Share this post


Link to post
Share on other sites
Alright, if no one else experiences it then it's definitely related to something local on us computer. Hope you find the culprit :)
0

Share this post


Link to post
Share on other sites

1.  Figure out how to repeat the behavior.

2.  Use the jconsole utility that comes with the jdk to profile what is happening.

3.  Assume that it is your code, and not Java (this is really hard).

2

Share this post


Link to post
Share on other sites

I know this is gonna sound dumb, but have you restarted your computer and cleared unnecessary start up programs? XD lol

 

Just my 2 cents. 

0

Share this post


Link to post
Share on other sites

This sound to me like one of these times you did an obvious change somewhere in the code, a change that you thought wouldn't alter anything (but it did), and you left it untested because you thought you just made a cosmetic change.  Then maybe you wrote a bunch of new code, and then suddenly the game starts behaving in weird ways, and now you forgot exactly what changes you did...

 

I have done that myself a few times, swearing at not checking my code in to the SVC system more often than I do, since it would be trivial to do a DIFF to find exactly what changes I have actually done lately...

 

Sometimes I even play my code backwards to find out what exactly I have done (lots of undos - if I even have the change in the undo buffer), in desperation to see what changes I actually did.

 

Morale of the story is to use the SVC system as often as reasonable. (For every logical unit of change.)

 

Oh, and on the undo - game, make sure you make a full copy of your source before you do a massive undo, since even a touch of a wrong key will make you lose everything so you can't redo it again.  (Or even if the IDE crashes for some reason.)

0

Share this post


Link to post
Share on other sites

This sound to me like one of these times you did an obvious change somewhere in the code, a change that you thought wouldn't alter anything (but it did), and you left it untested because you thought you just made a cosmetic change.  Then maybe you wrote a bunch of new code, and then suddenly the game starts behaving in weird ways, and now you forgot exactly what changes you did...

 

I have done that myself a few times, swearing at not checking my code in to the SVC system more often than I do, since it would be trivial to do a DIFF to find exactly what changes I have actually done lately...

 

Sometimes I even play my code backwards to find out what exactly I have done (lots of undos - if I even have the change in the undo buffer), in desperation to see what changes I actually did.

 

Morale of the story is to use the SVC system as often as reasonable. (For every logical unit of change.)

 

Oh, and on the undo - game, make sure you make a full copy of your source before you do a massive undo, since even a touch of a wrong key will make you lose everything so you can't redo it again.  (Or even if the IDE crashes for some reason.)

He has already stated that this happens with previous builds as well:

 


Tried to reinstall drivers, didn't work, i'm clearing memory, and never seen any fps drops. It worked fine before i implemented online multiplayer i think, but i have backups from before that and they lag the same way now, so i don't think it's the code, none of my friends i tested multiplayer experienced any lag. So i think it's my computer...

0

Share this post


Link to post
Share on other sites

I would start by tracing the coordinates of the rendered area vs the player coordinate, just to be sure that it behave as expected.

 

If the trace shows that coordinates changes smoothly, then there is a problem with the rendering. If not, then there is a problem in the scrolling code.

2

Share this post


Link to post
Share on other sites

He has already stated that this happens with previous builds as well:

 

 


Tried to reinstall drivers, didn't work, i'm clearing memory, and never seen any fps drops. It worked fine before i implemented online multiplayer i think, but i have backups from before that and they lag the same way now, so i don't think it's the code, none of my friends i tested multiplayer experienced any lag. So i think it's my computer...

 

 

Oh didn't notice that part.  Sorry.  Zodaz: Do you have any restore points from before you installed all those games you tried?

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0