<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
	<title>VERGE 3 Forums</title>
	<link>http://verge-rpg.com/rss/forums/</link>
	<description>verge-rpg.com's most recent forum postings.</description>
	<language>en-us</language>
	<pubDate>Tue, 22 May 2012 02:33:10 GMT</pubDate>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<generator>Egometry Ventures</generator>
	<managingEditor>mcgrue@verge-rpg.com</managingEditor>
	<webMaster>mcgrue@verge-rpg.com</webMaster>
		
		<item>
	<title>Java VERGE (by mcgrue)</title>
	<link>http://verge-rpg.com/news/java-verge/</link>   
	<description><![CDATA[As documented in the thread http://verge-rpg.com/forums/verge-developers-forum/jverge , Rafael_Esper has released a set of java tools to provide verge-like api and format loading to game makers!

Of note is that while it supports familiar API calls, all of the game scripting is done directly in java.  There is no Lua or VC here, so reimplementation will be a factor if you choose to use this for an existing project.

The engine and some example games are available on github:
https://github.com/rafael-esper/JVerge
https://github.com/rafael-esper/Ak
https://github.com/rafael-esper/Sully
https://github.com/rafael-esper/PS


[b]Some screenshots![/b]
Are in the folder at https://github.com/rafael-esper/JVerge/tree/master/screenshots<br /><br /><a href="http://verge-rpg.com/forums/reply/134597/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Apr 29th 2012, 20:28 GMT</pubDate>
	<guid>http://verge-rpg.com/news/java-verge/</guid>
	</item>
		<item>
	<title>JVerge (by mcgrue)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/jverge/</link>   
	<description><![CDATA[The 2005 version of Sully (Which I put about 5 months into) was a victim of v3's lack of debugging tools, and was (and is) ridiculously unstable.

I've actually just been working on recoding it in XNA to release on Xbox with Gayo, Hahn and Kildorf.  It's being heavily altered (a buttload of new art and music), and the "original flavor" Sully will remain in the public domain, though.<br /><br /><a href="http://verge-rpg.com/forums/reply/134596/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Apr 29th 2012, 20:20 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/jverge/</guid>
	</item>
		<item>
	<title>Pun RPG Enemy Names (for Sully) (by mcgrue)</title>
	<link>http://verge-rpg.com/castle-heck/pun-rpg-enemy-names-for-sully/2/</link>   
	<description><![CDATA[[12:32:50] <kildorf> DIRE PORPOISES is pretty great
[12:33:04] <kildorf> HYSTERICAL PORPOISES can be good in context as well<br /><br /><a href="http://verge-rpg.com/forums/reply/134595/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Apr 29th 2012, 19:34 GMT</pubDate>
	<guid>http://verge-rpg.com/castle-heck/pun-rpg-enemy-names-for-sully/2/</guid>
	</item>
		<item>
	<title>JVerge (by rafael_esper)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/jverge/</link>   
	<description><![CDATA[[b]JVERGE: what is it?[/b]

JVerge is an attempt to bring all the Verge engine into Java. All the C-dependent code was removed and changed by a Java counterpart. 

That means: all video/sound/music/keyboard/mouse code. The VC library code was adapted as needed (rect/circle/triangle/blit/etc), and some functions weren't implemented, specially the File, Socket, Movie playback and Window functions.

JVerge has some new features: wrapable maps, as described in another topic, and the ability to play VGM/VGZ files (from Sega Master System, Genesis and other consoles).

JVerge does NOT parse VC or LUA scripts. It's more like a Java API, so you write code in Java and use JVerge functionality.  
Java is multiplataform, so I hope JVerge runs ok in any Windows, Mac, Linux and other systems with a Java Virtual Machine (JVM). In the future, maybe it could be possible to adapt it to Android and other similar platforms.

I have implemented three demos to show JVerge working:

- Phantasy Star remake: I've converted just a small portion of my original Verge PS remake, because I plan to come back later and actually finish this project. It's a common FF/PS-like game, with a top view and 2D chars walking in the map. It's using a 480x320 resolution, same as Ipad, I think.  

- Alex Kidd: It's here to show that Verge is not just about RPGs. Alex Kidd was a popular 2D platform game in Sega Master System. I've added my own levels and plan to extend it later. 

- Sully Chronicles: Well, converting Sully was very useful to fix a lot of errors, misconceptions and buggy code in my JVerge engine conversion. Now the engine is way more stable. But I've performed a direct conversion - that was faster than rewriting the Sully code to the Java paradigm.

I've packed them in .JAR executable jars (just run java -jar X.jar). It's also possible and recommended to developers to use an IDE like Eclipse or Netbeans, place the project there and see the source code running smoothly, understand it better, etc.
They are also separate projects/GIT repositories. For developers: Ak, Ps and Sully are dependent of JVerge. If you just want to experiment the demos, there are a 'redist' folder in each project with an executable JAR. 

[url]https://github.com/rafael-esper/JVerge[/url]
[url]https://github.com/rafael-esper/Ak[/url]
[url]https://github.com/rafael-esper/Sully[/url]
[url]https://github.com/rafael-esper/PS[/url]

There are some screenshots in JVerge 'screenshots' folder.

[b]Some important notes[/b]
- F5 for sound off/on
- F6 for full screen
- F7/F8 to increase/decrease frame delay.
- You can write your custom verge.cfg and place it in the same folder of the .jar file
- If it is running very slowly, try to run via "java -jar X.jar" or install a new version of Java and associate it with .jar files. Windows comes with a very outdate version o Java. 

[b]JVERGE: The Future[/b]

In a next release, I plan to change the JVerge code into something more OO, like placing the methods inside the domain classes, e.g., printstring inside VFont, rect/circle/blit/etc inside VImage, playmusic inside VMusic, and so on.  

There are some unimplemented functions, possible bugs, and interesting things to do. 

If someone is interested in the project, I'd be happy to help extending JVerge to whatever we can think of. I'm eager to receive some feedback, suggestions, etc.

[b]NOTES ON SULLY CONVERSION[/b]

My initial goal was to show that the main tech demo would work properly with the Java engine, but now it is an example of a mindless bad programming practice: lots of static and public methods and properties, lots of static imports, and a general disoriented object programming.

- Some variables were converted to boolean. In Java you can't do: "while(count)", if count is an int. Need to change to "while(count !=0)"
- Add "break" clause after each "case" in the "switch" clause (unlike VC).
- A lot of methods and properties were changed to static. This is so anti-OO. :-(
- There is no script code being interpreted, it's just Java code. So the map() function can't just stop the remaining code to run. 
- In order to implement the Sully introduction (that can be escaped anytime with Esc), I've opted to create a Java thread and use the ugly and deprecated method stop. I could have done this in a more elegant way, but the code would be changed a lot more.  
- Java imports are different from C includes. So in order to call a function of an outer file, that would be normally included in C, I had to add a "path" parameter to the callfunction method.
- Unlike VC, Java is case-sensitive. A lot of calls were changed because of this.
- As SetClip is not yet implemented, I've changed a little the textbox behavior to produce the same effects.
- The "|" text delimiter was changed to "&", because "|" has another meaning to regex String function. Needed to change this in all Menus and Shops. 
- I've performed some changes in the simpletype_rpg package, creating the structs (in Java, classes) in the corresponding classes. Not enough to be really OO, though.
- Reimplemented the data_load with Java File API. Not very hard to convert (just text files). But the token separator was changed to a tab ("\t"), and just ONE tab in the .dat files. 
- Data_load strcmp was different from expected, so changed !strcmp to strcmp and vice-versa
- The item "Cap" is just three letters long, so was interpreted as junk, because of MIN_LINE_LENGTH. Changed to LongCap.
- I've changed some MenuOff() and MenuOn() calls to EntStart() and EntFinish(), because somehow, the player wasn't stopped in the dramatic scenes, shops, etc.
- There were some bugs in the original code, like accessing a -1 index in an array in the AddPlayerI() function. Those bugs become evident in the Java code, as it's now allowed.
- There were some strange TextBox without the comma (like TextBox(PORTRAIT, "a" "b", "c"); How these were working?!
- Load/Saving works fine outside the executable Jars (like in Eclipse or just running java directly). But when packing the code in a .JAR, I wasn't able to deal with saving files externally to the JAR, but loading files works fine. I'm thinking about a solution to this problem.  
- I had a lot of problems with case-sensitive stuff (because JAR files are case-sensitive). 
- There were some unused variables.
- I see that there is another version of Sully somewhere, judging by screenshots. Is the code available?
<br /><br /><a href="http://verge-rpg.com/forums/reply/134594/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sat, Apr 28th 2012, 15:13 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/jverge/</guid>
	</item>
		<item>
	<title>JVerge (by mcgrue)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/jverge/</link>   
	<description><![CDATA[Oh, man.  Of course you can host them here.  Let's go front page with this shiznits :D<br /><br /><a href="http://verge-rpg.com/forums/reply/134589/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Mar 11th 2012, 05:04 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/jverge/</guid>
	</item>
		<item>
	<title>JVerge (by rafael_esper)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/jverge/</link>   
	<description><![CDATA[Ok, I really have the guts to come back here without placing my JVerge code in Github, but I have a reason (not a good one):

I'm finishing the engine code and converting Sully to this new engine. Since my last reply I've spent +50 hours working with it, and now I have:

- Function calls, hooks and all this stuff;
- VC lib Drawing functions (almost all of them: blit, tblit, setlucent, setpixel, grabregion, circle, rect, fill*, triangle, silhouette etc);
- Fonts (Java cross-platform fonts and a VFont object corresponding to Verge fonts);
- Fast full screen (had to deal with double buffering and Volatile images).

NEEDS TO BE DONE:
- Github (Ok, next post I promise the code is going to be there)
- Investigate some screen flickering when using colorfilter (like putting the screen to grayscale)
- Test unused functions so far, and develop test functions
- Add proper logging capabilities
- Finish Sully conversion
- Document code and include LICENSE and CREDITS

I would also like to make it more OO, because in order to have a code like:

[code]
	static void DrawBox(int a, int b, int c, int d) {
		setlucent(15);
		rectfill(a+4,b+4,c+a,d+b, new Color(30,30,150), screen);
		rect(a+3,b+3,c+a-3,d+b-3,new Color(60,60,60), screen);
		rect(a+2,b+2,c+a-2,d+b-2,new Color(90,90,90), screen);
		rect(a+1,b+1,c+a-1,d+b-1,new Color(90,90,90), screen);
		rect(a,b,c+a,d+b,new Color(60,60,60), screen);
		setlucent(0);
	}
[/code]

The rect, rectfill, setlucent and screen need to be Public and Static in Java. So there are a lot of those methods.

Mcgrue, when I release the code in Github, I would also like to release some screenshots, as I currently have 2 working demos and soon Sully will work too. Can I host them here?

Thanks, and I'd really appreciate any suggestion, questions or comments. 

Rafael, the Esper. 

<br /><br /><a href="http://verge-rpg.com/forums/reply/134588/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sat, Mar 10th 2012, 19:57 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/jverge/</guid>
	</item>
		<item>
	<title>Pun RPG Enemy Names (for Sully) (by Gayo)</title>
	<link>http://verge-rpg.com/castle-heck/pun-rpg-enemy-names-for-sully/2/</link>   
	<description><![CDATA[Grue came up with [b]Hemogoblin[/b]. <br /><br /><a href="http://verge-rpg.com/forums/reply/134587/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Feb 19th 2012, 11:05 GMT</pubDate>
	<guid>http://verge-rpg.com/castle-heck/pun-rpg-enemy-names-for-sully/2/</guid>
	</item>
		<item>
	<title>JVerge (by mcgrue)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/jverge/</link>   
	<description><![CDATA[giiiiiithub? :D<br /><br /><a href="http://verge-rpg.com/forums/reply/134585/">Reply to this message?</a><hr>]]></description>
	<pubDate>Mon, Jan 23rd 2012, 20:11 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/jverge/</guid>
	</item>
		<item>
	<title>JVerge (by rafael_esper)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/jverge/</link>   
	<description><![CDATA[Ok, some news:

- Not in Gith yet! (I'm going to make it soon)
- Playing .MOD, .S3M, .XM, .MP3, .WAV, .VGM, .VGZ and some others formats;
- Reading and saving .map, .vsp, .chr (version 2, 4 and 5)
- Map rendering, controls, player, entities, animations, showpage... the main engine is all here.
- Loading Config file.

Needs to be done:
- Function calls (this is a fundamental step)
- VC lib Drawing functions (this is going to be easy)
- Fonts
- VC Parser and/or Lua Parser (probably won't be done)
- Make it more OO
- Full screen is very slow, I need to adapt it to the graphic JGame implementation I'm using. 320x240 works fine, through.
- Add logging capabilities

Any suggestion is much appreciated. 

Regards,
Rafael, the Esper
<br /><br /><a href="http://verge-rpg.com/forums/reply/134584/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Jan 22nd 2012, 15:44 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/jverge/</guid>
	</item>
		<item>
	<title>Wraparound Maps: Done! (by rafael_esper)</title>
	<link>http://verge-rpg.com/forums/verge-developers-forum/wraparound-maps-done/</link>   
	<description><![CDATA[Ok, as I've mentioned earlier, this was in my top 3 list of verge features I'd like to see. 

Well, the code below is in Java, but it's very close to the original CPP code. I've implemented this in
my Java verion of Verge (I'm calling it JVerge), and it's almost ready for a first release ([url]http://verge-rpg.com/forums/verge-developers-forum/jverge/[/url])

Here it goes:

In the Map, add two variables to control if the map is wrapable (horizontal-edges and vertical-edges):

[code]
	public boolean horizontalWrapable = false;  // new code
	public boolean verticalWrapable = false;  // new code
[/code]

Of course, you need to set these variables at some point for your World maps, like:
[code]
	current_map.horizontalWrapable = current_map.verticalWrapable = true;
[/code]

In the Render method, if the map is wrapable, don't limit the xwin and ywin:

[code]
			case 1:
				if( myself != null )
				{
					xwin = (myself.getx() + myself.chr.hw/2) - (screen.width / 2);
					ywin = (myself.gety() + myself.chr.hh/2) - (screen.height / 2);
				}
				else { xwin=0; ywin=0; }
				
				if(!current_map.horizontalWrapable) { // new code
					if (xwin + screen.width >= rmap)
						xwin = rmap - screen.width;
					if (xwin < 0) xwin = 0;
				}
				if(!current_map.verticalWrapable) {  // new code
					if (ywin + screen.height >= dmap)
						ywin = dmap - screen.height;
				
					if (ywin < 0) ywin = 0;
				}
				break;
[/code]

In the method obstructpixel of the Map class, the edges aren't obstructable anymore for wrapable maps. My (messy) code is like this:

[code]
	public boolean obstructpixel(int x, int y) { // modified by rbp
		if (!horizontalWrapable && (x < 0 || (x >> 4) >= getWidth()))
				return true;
		if (!verticalWrapable && (y < 0 || (y >> 4) >= getHeight()))
				return true;
		if(horizontalWrapable && x < 0)
			x+= (getWidth() << 4); 
		if(horizontalWrapable && (x >> 4) >= getWidth())
			x-= (getWidth() << 4);
		if(verticalWrapable && y < 0)
			y+= (getHeight() << 4); 
		if(verticalWrapable && (y >> 4) >= getHeight())
			y-= (getHeight() << 4);
		
		int t = obsLayer[((y >> 4) * getWidth()) + (x >> 4)];
		if (tileset.GetObs(t, x & 15, y & 15) == 0)
			return false;
		return true;
	}
[/code]

In the same class, in the BlitLayer method, now you want to render the beginning of the map when you're close to its end, and vice-versa:
Original code was something like: c = layer.GetTile(xtc + x, ytc + y); Now you need to change it to:

[code]
				if(horizontalWrapable && verticalWrapable)  // New code
					c = layer.GetTile((xtc + x+getWidth())%(getWidth()), (ytc + y+getHeight())%(getHeight()));
				else if(!horizontalWrapable && verticalWrapable)
					c = layer.GetTile((xtc + x), (ytc + y+getHeight())%(getHeight()));
				else if(horizontalWrapable && !verticalWrapable)
					c = layer.GetTile((xtc + x+getWidth())%(getWidth()), (ytc + y));
				else if(!horizontalWrapable && !verticalWrapable)
					c = layer.GetTile(xtc + x, ytc + y);

[/code]

In the Entity class, the getx() and gey() methods need to "teleport" the entity to the beginning of the map, if they go past its end. Also, we need to adapt the waypoint, so the entity won't walk backwards when it reachs the end of the map (because the entity X is 100, and the waypointX 116 can be converted to 16, in a 100x100 map):

[code]
	public int getx() {
		if(current_map.horizontalWrapable && 
				(x/65536 > current_map.getWidth()<<4 || x < 0)) {
			x = (x + (current_map.getWidth()<<20)) % (current_map.getWidth()<<20);
			waypointx = (waypointx + (current_map.getWidth()<<4)) % (current_map.getWidth()<<4);
		}
		return x/65536;	}
	
	public int gety() { 
		if(current_map.verticalWrapable &&
			(y/65536 > current_map.getHeight()<<4 || y < 0)) {
				y = (y + (current_map.getHeight()<<20)) % (current_map.getHeight()<<20);
				waypointy = (waypointy + (current_map.getHeight()<<4)) % (current_map.getHeight()<<4);
			}		
		return y/65536; 	}
[/code]

Remember to make the class more OO, and all instances do entity.x and entity.y are converted to entity.getx() and entity.gety(). 

Finally, the draw method of entity needs to render the entities that are on the other side of the map:

Instead of 

[code]
		int zx = getx() - xwin,
		    zy = gety() - ywin;
[/code]

Change it to:

[code]
		int zx = (getx() - xwin + (current_map.getWidth()<<4)) % (current_map.getWidth()<<4),
		    zy = (gety() - ywin + ((current_map.getHeight()<<4))) % (current_map.getHeight()<<4);
[/code]


And that's it. It can be easily adapted to CPP code. Wraparound maps in Verge! Tested with my old Phantasy Star maps.

Regards,
Rafael, the Esper
<br /><br /><a href="http://verge-rpg.com/forums/reply/134583/">Reply to this message?</a><hr>]]></description>
	<pubDate>Sun, Jan 22nd 2012, 15:34 GMT</pubDate>
	<guid>http://verge-rpg.com/forums/verge-developers-forum/wraparound-maps-done/</guid>
	</item>
		
	</channel>
</rss> 
