Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Changing values during runtime?  (Read 1137 times)
0 Members and 1 Guest are viewing this topic.
Offline purebordem

Junior Newbie





« Posted 2011-12-09 17:44:41 »

Hello
I know this seems like a silly question, I'm not that new to java, but somethings been bugging me

you see, when I watched Notch coding during the last LD competition over a livestream, it looked like he was editing values and adding whole chunks of code without needing to re-run it.

I kinda thought at first that maybe he was editing a properties file or something but when I looked closer he was actually changing things like the parameters for glColor3f or paths to textures and his applet would not restart. He would even add in more code like function calls if I remember correctly, it wouldn't close or anything, he would be in the same position he was in when he started changing code and yet textures and colors would change as he coded it. He did restart sometimes but there didn't seem to be a pattern in what he changed when he restarted and when he didn't, though I can't remember clearly.

From what I could tell I thought he was using eclipse, I can't really remember now since it was quite a while ago, but I'm wondering if there was maybe some sort of special compiler or something that did this? I've searched the internet several times but to no avail....
Offline xsvenson
« Reply #1 - Posted 2011-12-09 17:51:53 »

This has been asked before and also answered around these boards. If You search around these boards You will find. You may want to use "hot swapping" as keywords.

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Offline Orangy Tang

JGO Kernel


Medals: 51
Projects: 11


Monkey for a head


« Reply #2 - Posted 2011-12-09 18:11:20 »

If you use Eclipse it's built in, it's triggered when you save a source file when the program is being run under the debugger.

It's under Preferences->Java->Debug, but IIRC it's on by default.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie
« Reply #3 - Posted 2011-12-09 18:47:24 »

Just to clear it up, hot swapping is a Java feature, supported by every IDE, not just Eclipse.  There's limits to what you can do with it, but any good IDE will tell you if your change isn't hotswappable and requires a restart instead.


Offline purebordem

Junior Newbie





« Reply #4 - Posted 2011-12-10 15:22:13 »

Thanks, I never heard the term hotswapping before, so I guess thats why I never found it Tongue
Offline philfrei
« Reply #5 - Posted 2011-12-11 07:33:48 »

And I will wait 24 hours before I "appreciate" sproingie, too, due to the recently acquired knowledge that appreciations close together in time are not worth as much as isolated appreciates.

Really nice to know this, about hot-swapping! Am looking forward to giving it a try.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline cylab

JGO Knight


Medals: 34



« Reply #6 - Posted 2011-12-11 11:23:21 »

Just to clear it up, hot swapping is a Java feature, supported by every IDE, not just Eclipse.
It's called "Apply code changes" located in the Debug menu in Netbeans for example. Unfortunately it can't be configured to automatically run on save, so one keypress more Wink

Mathias - I Know What [you] Did Last Summer!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (20 views)
2014-04-15 18:08:23

BurntPizza (16 views)
2014-04-15 03:46:01

UprightPath (29 views)
2014-04-14 17:39:50

UprightPath (14 views)
2014-04-14 17:35:47

Porlus (30 views)
2014-04-14 15:48:38

tom_mai78101 (55 views)
2014-04-10 04:04:31

BurntPizza (112 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!