Jump to content

  • Log In with Google      Sign In   
  • Create Account


Shippou

Member Since 24 Nov 2011
Offline Last Active Aug 17 2014 09:27 AM

#5174071 Help with ArrayList Java

Posted by Shippou on 16 August 2014 - 05:38 AM

This code should theoretically work, however I haven't tested it ( getting ready for work as I type this message ) .

ArrayList <Object> Something = new ArrayList <Object>() ; 

 "Object" is a generic that should be able to hold any kind of object .




#5173824 Making a 2d browser Game

Posted by Shippou on 15 August 2014 - 02:30 AM

Be aware that you need to have quite a bit of IT knowledge to get Node.js and Socket.io to operate correctly on your server.

 

 If you choose remote hosting service , Node.js & Socket.io are either poorly supported or  complicated to set up .




#5173236 Offsetting 3D Points Based On Rotation + Position Of Camera

Posted by Shippou on 12 August 2014 - 07:02 PM

I seem to be getting a lot of EOB errors and inconstant data - this worked fine before the math was introduced . sad.png

int xx = width/2 ;
	    int yy = height/2 ;
	   
	   for (int i = 0; i < 361; i++){
		  //img = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
		   pixle( (int)( xx * Math.cos(i) - yy * Math.sin(i) ) ,(int) ( xx * Math.sin(i) +  yy * Math.cos(i) ) );
		   frame.repaint();
		   sleep(5);
	   }
[snip]
public void pixle(int x,int y){
		 System.out.println("~" + c + "\n" + x + " " + y );
		 try{
		 img.setRGB(x, y, color.getRGB() );
		 img.setRGB(x + 1 , y, color.getRGB() );
		 img.setRGB(x -1 , y, color.getRGB() );
		 img.setRGB(x , y + 1, color.getRGB() );
		 img.setRGB(x, y - 1, color.getRGB() );
		 } catch(Exception e){System.out.println("Error - EOB");}
		 c+= 1 ;
	 }

 

// without the try block

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
    at sun.awt.image.IntegerInterleavedRaster.setDataElements(Unknown Source)
    at java.awt.image.BufferedImage.setRGB(Unknown Source)
    at me.RLS0812.Mic_Code.b.pixle(b.java:72)
    at me.RLS0812.Mic_Code.b.<init>(b.java:44)
    at me.RLS0812.Mic_Code.Main.main(Main.java:23)

 

// with try block

~1
341 192
~2
22 390
Error - EOB
~3
-316 230
Error - EOB
~4
-364 -141
Error - EOB
~5
-77 -383
Error - EOB
~6
280 -272
Error - EOB
~7
381 89
~8
130 368
~9
-239 309
Error - EOB
~10
-389 -34
Error - EOB
~11
-181 -346
Error - EOB
~12
193 -340
Error - EOB
~13
390 -20
Error - EOB
~14
228 317
~15
-143 364
Error - EOB
~16
-383 75
Error - EOB
~17
-271 -282
Error - EOB
~18
90 -380
Error - EOB
~19
369 -129
Error - EOB
~20
308 240
~21
-36 389
Error - EOB

[snip]




#5172495 How do I build an real, existing city in a game

Posted by Shippou on 09 August 2014 - 01:28 PM

Before taking on a large scale 3D project like this, you probably need to plan things out first.

 How many pictures / drawings / descriptions do you have of each building type ?

If you are going for the realistic approach ( this will require a lot of preplanning ), you need to start with a "mock up" of the basic layout of the city.

 You do not need fancy tools to accomplish this, you are just trying to get a perspective of what you going to build.

Active Worlds would probably provide the EASIEST environment to mock up a city layout ( and it's free as long as you are not planning on doing anything permanent ).

 Once you get a good idea for layout, you need to make basic mockups of each unique building you wish to build.

The easiest tool I know of for ( buildings / roads / objects ) mockup would be Google Sketchup .

 After you get a good idea of exactly how you want each of your buildings to look, it's time for the hard work to start.

Using a 3D modeling tool such as Blender 3D ( free ) or Maya 3D ( not free ) you need to carefully sculpt and texture your buildings based on your mockups .

 

 From there, you need to import them into Unity 3D, than carefully arrange everything according to the city mockup you made.

 

Note: you may also need to create a height map for terrain ...




#5171237 Are there engines out there made for Minecraft clones?

Posted by Shippou on 03 August 2014 - 03:28 AM

 

zero programming experience

 

My time is limited

.

Regardless of what you choose, you need to put in a lot of time and effort to learn whatever "engine" you choose.

1: You need a solid plan on what you want to do - "MineCraft clone" is not that simple.

2: You need to research what each engine is capable of ... there are no engines out there that can do MineCraft with out you a doing a lot of coding .

 

 With that said, the easiest rout would be creating plugins for Bukkit or MineCraft Forge ( depending on what you want to do ) .

Be aware that some time after MineCraft 1.8 is released, there will be a built in API for making plugins .

 Note: You will have to learn Java to make these plugins.




#5169577 An array with multiple data types

Posted by Shippou on 27 July 2014 - 01:53 PM

You can do different data type arrays in Python, Ruby, PHP and JavaScript

 

 Are you looking for something like a HashMap or Dictionary ?




#5169478 Hiring people to create a game for you

Posted by Shippou on 27 July 2014 - 07:11 AM

@Hodgman

+1

 

 You need to have more than a simple idea to get the ball rolling on a project. You need to figure out:

 

* Game "story line" if applicable ( some companies hire famous authors )

* Type of game ( RPG, FPS, building, adventure, a combination of many, e.t.c. )

* Target audience ( you can't please everyone )

* Target platforms ( Phones, PC, PS4, Commodore 64, e.t.c.  )

* Budget

 

 ( Unfortunately, throwing money at a room full of people who are given poor direction, will not yield good results. )

 

 After all that is figured out, you need to prototype the game to see if it actually "works" ( is a good idea )  and if you can get others interested .




#5167807 Funniest line of code ever ?

Posted by Shippou on 19 July 2014 - 09:05 AM

I have once seen a junior colleague of mine do a gentle modification

if (l.code==86)

{

 ....

}

// jan grubenar #

if (l.code==86)

{

....

}

// jan grubenar *

.

This person did not know what a while loop was ?

.

boolean run = true;

while (run){
     if (l.code == 86){
          //do stuff
     {
  {




#5166770 How to get known and greenlit when your product is not a game?

Posted by Shippou on 14 July 2014 - 12:22 PM

You have a lot of competition - what exactly makes your generator any different or better?

 

Edit: you need a lot better demo video and pictures to "wow" folks with.

From what is presented, this "product" appears to be very outdated.




#5166763 How To Make Combat Formulas Work Better ?

Posted by Shippou on 14 July 2014 - 11:59 AM

 I have been running combat simulations on and off for the last couple days, and I have been having issues making every thing "work" together to create a smooth running system.

 Here is what I have, maybe someone can figure out a better system than what I have.

( this is real time combat )

 

Combat Level - derived from several of the base skills ( haven't figured out a good way to calculate this yet )

HP - health ... regenerates based on combat level

MP - magic ... regenerates based on combat level

RP - religion ... regenerates based on combat level

Strength - how hard something can hit

Accuracy - percent added to damage

Agility - percentage chance of dodging some or all of an attack

Defense - amount of damage that can be absorbed

Armor - percentage of damage that can be absorbed

Luck - positive or negative random effect

 

* A difference of 3 or more combat levels between the combatants will change percentage of damage dealt and damage taken

* The level of MP & RP is the attack and defence level.

 

 

 Hit Given =  (Strength * (Accuracy bonus + luck) ) * combat level difference penalty or bonus percentage

 Hit Taken = (Hit Given - ( (Defense * armor bonus) * (agility bonus + luck) ) ) * combat level difference penalty or bonus percentage




#5166114 c++ basics

Posted by Shippou on 10 July 2014 - 09:08 PM

A few things that will pop up when jumping into C++ from a scripting language...

1: If you want to use strings ( or don't want to write overly complex code to handle strings ) , better memorize this line of code
 


using namespace std; // some folks don't like using it due to "conflicts"

2: "<<" = output ... ">>" = input

// << is also the equivalent of + 
cout << "Hello World !" << endl;
// or
cout << "Hello " << "World !" << endl;

3: Variable types have to be declared !

4: Don't attempt pointers until you understand memory management "do s" and "don't s"

5: Learn how to write header files correctly

6: C++ classes do not quite work the same as Python's classes . C++ classes can be dangerous to new comers due to manual memory management requirements.




#5165738 Simple Socket Server Is Continuing To Crash

Posted by Shippou on 08 July 2014 - 11:42 PM

 

I found the problem - this has to be the one of the most obscure type of serialization errors that exist in Java !

 When sending a serialized object over a socket to a different JVM, the package name has to be the exact same for both the client and the server ( Java 1.7 ) .

 

How in the world did you figure that out?  

 

And what kind of Java networking stuff are you doing?  I've done lots of that stuff if you need any advice.

 

 

 I was Goggling many different forum posts about ClassNotFoundException for almost an hour and half - I found the answer deep in a thread about serializing files that are read by several different programs.

 As of right now I am attempting to send several different objects across a Client - Server pair ( map updates, player stats, server event messages ). This will be eventually integrated into my pre-existing ASCII rendering engine.

 The goals of this will be to have a MUD like virtual world, with up to 200 players at one time.

 

TODO: multi-threading each user who connects to the server - develop port listeners - develop 2 way communication - multi-thread server/client actions and socket actions

(( Milt-threading will probably be put on the back burner for a long while ))

 

Here is the current version of the code I have:

Common object:
 



class Test_Obj implements Serializable {  
int a ;  
String b;  
	public  Test_Obj(int i, String s ){  
			a = i;
			b = s;
	}

}

Client



public class Client {
	public static void main(String args[]) {
	
	try{  
		Socket s = new Socket("127.0.0.1",9999);  
		OutputStream os = s.getOutputStream();  
		ObjectOutputStream oos = new ObjectOutputStream(os);  
		Test_Obj to = new Test_Obj(999,"Hello World !");  
		oos.writeObject(to);  
		oos.flush();
		oos.close();  
		os.close();  
		s.close();  
		}
	catch(Exception e){
		System.out.println("Client: " + e);
		}  
	}  
}

Server


public class Server  {

	public static void main(String args[]) {  
		try {  
		ServerSocket ss = new ServerSocket(9999);  
		Socket s = ss.accept();  
		InputStream is = (InputStream) s.getInputStream(); 
		ObjectInputStream ois = new ObjectInputStream(is);
		Object in = ois.readObject();
		if (in != null){
			if (in instanceof Test_Obj ){
				Test_Obj to = (Test_Obj) in ; 
				System.out.println(to.a + " " + to.b);
			}
			else{
				System.out.println("Error, wrong object passed !");
				}
		}  
		is.close();  
		s.close();  
		ss.close();  
		}
		catch(Exception e){
			System.out.println("Server: " +e);
				}  
			}  
		}



#5165716 Simple Socket Server Is Continuing To Crash

Posted by Shippou on 08 July 2014 - 08:13 PM

I found the problem - this has to be the one of the most obscure type of serialization errors that exist in Java !

 When sending a serialized object over a socket to a different JVM, the package name has to be the exact same for both the client and the server ( Java 1.7 ) .




#5165667 Simple Socket Server Is Continuing To Crash

Posted by Shippou on 08 July 2014 - 04:37 PM

After compiling this and running outside of a test environment, the server kicks up the error "ClassNotFound : Client.Test

 

 Re-wrote the code, and received the same error (( both client and server package have a copy of the Test class ))

I than commented out the object, and instead sent a string - and it worked ... Why can't I send serialized objects ?!




#5164140 How to transition into Game Dev with Java

Posted by Shippou on 01 July 2014 - 04:37 PM

For 3D applications you can use built in libraries, or try download a 3rd party API .

 

 Believe it or not, Java's built in libraries make it very easy to do many different types of networking applications ( socket programming ).

You can start with a simple chat program, move up to sending objects using serialization, than try your hand at multithreading .

 Once you get this part learned, it is very simple to create the network backbone for almost any kind of game.

 

Edit: Java is not a language to use for large scale 3D games. Attempting to render complex 3D shapes with texture mapping and lighting can bring your game to a screeching halt.

 (( Java is a perfectly fine language to use for 2D MMOs, and non graphic intensive 3D games ))






PARTNERS