Show Posts
|
|
Pages: [1] 2 3 4
|
|
2
|
Game Development / Newbie & Debugging Questions / Re: Loading files after export
|
on: 2013-03-01 02:25:38
|
Project/ ../bin/ ../bin/res/myres_IN.txt // auto moved here from /src/ when run application (Eclipse) ../res/ ../res/myres_Out.txt ../src/ ../src/res/myres_IN.txt
i use this =) for in jar - wher: path = res/myres_IN.txt (../src/res/myres_IN.txt) 1 2 3
| ClassLoader c = ClassLoader.getSystemClassLoader(); InputStream is = c.getSystemResourceAsStream(path); if(is == null){throw new FileNotFoundException(path);} |
and for out - wher: path = res/myres_Out.txt (../res/myres_Out.txt) // need move res folder near jar when export it out have bug - need run like "java -jar blabla.jar" if you run from out folder like "java -jar folder_A/blabla.jar" (C:/folder_0/folder_A/blabla.jar) java search "res" in "folder_0" not wher jar itself (not in "folder_A")^^ 1 2 3
| File file = (new File(path)); if(!file.exists()){throw new FileNotFoundException(path);} InputStream is = new FileInputStream(file); |
i prefer out.
|
|
|
|
|
3
|
Discussions / General Discussions / Re: Why don't many of you sell your games?
|
on: 2013-02-24 22:39:21
|
IMHO: That all is way of luck - you can create 1 project and earn millions (minecraft), Or you can create hundreds project making money for living and maybe money for next project (Cortex Command, etc…), Or even you can create projects which will be not interesting to public and you not receive money at all (billions flash games…) 
|
|
|
|
|
4
|
Game Development / Newbie & Debugging Questions / Re: Game gets slower
|
on: 2013-01-26 15:31:31
|
You may use something like this 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| abstract public class D{ static private long last_Time_N; static private long last_Time_M; static public long T(){ return System.nanoTime(); } static public void T_Start(){ last_Time_N = System.nanoTime(); } static public void T_Print(){ System.out.println(System.nanoTime() - last_Time_N); } static public void T_Print(String text){ System.out.println(text + (System.nanoTime() - last_Time_N)); } static public long M(){ return System.currentTimeMillis(); } static public void M_Start(){ last_Time_M = System.currentTimeMillis(); } static public void M_Print(){ System.out.println(System.currentTimeMillis() - last_Time_M); } static public void M_Print(String text){ System.out.println(text + (System.currentTimeMillis() - last_Time_M)); } static public long Mem(){ Runtime runtime = Runtime.getRuntime(); return runtime.totalMemory() - runtime.freeMemory(); } }
{ D.T_Start(); D.T_Print("code fifi time : "); } |
|
|
|
|
|
5
|
Game Development / Newbie & Debugging Questions / Re: Game gets slower
|
on: 2013-01-26 13:53:47
|
Thanks for the code! I tested it and all values are around 9000. There are some outliers around 28000 and a few even at 40000 but they are rare. That's not too bad, right?
Yes, problem somewhere else, you need check other main functions, you must look on 100 000ns + that 0.1 ms In game with 60 fps 1 frame take 15 ms – 15 000 000 ns If you have random crazy slow down that don’t have direct place that maybe Java memory manager (GC, allocate more memory) Its easy to detect: because you have crazy time on simple functions like 1ms+ or so.
|
|
|
|
|
6
|
Game Development / Newbie & Debugging Questions / Re: Game gets slower
|
on: 2013-01-26 12:30:07
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| long t1 = System.nanoTime(); Label:{ if(check_Block(x - 1, y + 1, z - 1)) break Label; if(check_Block(x - 1, y + 1, z )) break Label; if(check_Block(x - 1, y + 1, z + 1)) break Label; if(check_Block(x , y + 1, z - 1)) break Label; if(check_Block(x , y + 1, z )) break Label; if(check_Block(x , y + 1, z + 1)) break Label; if(check_Block(x + 1, y + 1, z - 1)) break Label; if(check_Block(x + 1, y + 1, z )) break Label; if(check_Block(x + 1, y + 1, z + 1)) break Label;
if(check_Block(x - 1, y + 2, z - 1)) break Label; if(check_Block(x - 1, y + 2, z )) break Label; if(check_Block(x - 1, y + 2, z + 1)) break Label; if(check_Block(x , y + 2, z - 1)) break Label; if(check_Block(x , y + 2, z )) break Label; if(check_Block(x , y + 2, z + 1)) break Label; if(check_Block(x + 1, y + 2, z - 1)) break Label; if(check_Block(x + 1, y + 2, z )) break Label; if(check_Block(x + 1, y + 2, z + 1)) break Label; } long t2 = System.nanoTime(); System.out.println("Debug Colis time: " + (t2 - t1)); public boolean check_Block(int x, int y, int z){ Block b = currentChunk.getBlock(x, y, z); if(b != null && this.getBounds().intersects(b.getBounds())){ this.position.x = oldPos.x; this.position.z = oldPos.z; return true; } return false; } |
|
|
|
|
|
7
|
Game Development / Game Mechanics / Re: Possible to make an enum of anonymous inner classes?
|
on: 2012-12-06 17:29:45
|
without cluttering up my main code.
/*****************/ File 1 – bullets : Arraylist list Bullet 1 – id 1 Bullet 2 – id 2 get_By_ID(int id_Find){ for Arraylist Object obj = list.get(i) if(id_Find == obj.id) return obj } get_By_Name(String name_Find) if(name.equals(name_Find)) //Not lf(name == name_Find) Dont do that // Obj == obj - memory address !!!!! //... /*****************/ File 2 – Graphicks : //... /*****************/ File 3 - weapon new Weapon(1, 15); //Weapon bullet - id 1, Graphicks Id -15 new Weapon("Pistol_1", "Pistol_2"); //Weapon bullet Name - Pistol_1, Graphicks Name - Pistol_2
|
|
|
|
|
8
|
Game Development / Game Mechanics / Re: Possible to make an enum of anonymous inner classes?
|
on: 2012-12-06 17:15:56
|
Try do components object : (crazy and flexible ^^) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| class Bullet_Dmg implements Bulet_Procces { int Dmg; public Bullet_Dmg(int dmg){ Dmg = dmg; } @Override public void update(){ if(bulet hit do damage) } public Bullet_Dmg set_Dmg(int dmg){Dmg = dmg;return this;} } class Bullet_Heal implements Bulet_Procces {} class Bullet_Time_Explode implements Bulet_Procces {} class Weapon_Pistrol_Graphics implements Weapon_Graphics { @Override public void draw(Graphics g2d) { } } class WeaponObj{ Bulet_Procces proc; Weapon_Graphics graph; public WeaponObj(Bulet_Procces Proc, Weapon_Graphics Gra(){ proc = Proc; graph = Gra; } public void draw(Graphics g2d){ graph.draw(g2d); } public void update(){ proc.update(); } public WeaponObj set_New_Proc(Bulet_Procces Proc){proc = Proc; return this;} } Bullet_Dmg pistol_Bullet = new Bullet_Dmg(10); Weapon_Pistrol_Graphics pistol_GR = new Weapon_Pistrol_Graphics(); WeaponObj pistol = new WeaponObj(pistol_Bullet, pistol_GR); Bullet_Heal pistol_Bullet_2 = new Bullet_Heal(30); pistol.set_New_Proc(pistol_Bullet_2);
|
|
|
|
|
|
13
|
Games Center / Cube World Projects / Re: World of change
|
on: 2012-10-09 01:46:30
|
I loved all the plants and trees, they look awsome.
Thx, You fully right, I love it but I tired from it, About trees and plants, I still don't know what choose full 3D model, or maybe mini voxels, But some plants will look terrible in voxels like grass, but voxels give ppl ability easy create new items etc. Or do all in 3D terrain like in wow, I don’t know  I have too many misunderstandings in how next do this big project. And we already do so many voxel project I even start think if I realize my ppl not buy other – its so stupid (maybe I really stupid or its laziness talking in me) ) See I agene think about project =) Say true I really tired from voxels I even start hate them XD (I think not only me ^^) I want create small well know board game Monopoly, its not long but need find strength do that. I in depression now, I lose reason why I doing this (programming) (I pass phase : f**k you all, and now in phase: I don’t care ^^) Don’t want write my moral problems, you all have owns.
|
|
|
|
|
14
|
Games Center / Cube World Projects / Re: World of change
|
on: 2012-10-07 16:56:18
|
|
Sorry I don’t want create more hate Simple want say GL all.
(Forum work 1 year after that free rent(site) is over and I delete all links sorry ^^)
I maybe comeback later, or maybe not to this project =) What do more things, and finally start fully new project not thinking about this one.
|
|
|
|
|
15
|
Games Center / Cube World Projects / Re: World of change
|
on: 2012-10-07 09:07:47
|
Project Frozen. Thanks all for Read 12680 times this topic and 70 downloads. I remember one really funny story with my project, that I want to tell: In early version project I think that original MineCraft demo hold user world on server, and I start looking how do same, I find free hosting that can hold 40gb and write save system, that save player worlds on server, In theory hi can hold 200k-400k player, I think on that moment I find money to buy normal hosting  I from early beginning do all to hold as many player as I can if they interesting in my project (MineCraft on that moment have something like 2-3 mil register players) But I have only 3 ppl register there, I also have forum with 0 register there =) Goodbye all, I hope you finish yours projects. And one more time thx for everything.
|
|
|
|
|
17
|
Discussions / Miscellaneous Topics / Re: The Opus audio codec
|
on: 2012-09-13 19:01:46
|
50GB!!  90GB =) mp3 And some of my friends have 100-200 GB Most of them 99% Dj sets, I love Trance, Electro, House, Goa, Some times Hardstyle, Psy  O no I forgot Jazz, I love Jazz and Lounge XD I listen to a lot of music when I'm coding  Same ^^ P.s Sorry if I spam stupid messages, I love to chat, but some times I don’t understand what you’re talking about, that's why I so quiet XD
|
|
|
|
|
18
|
Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language
|
on: 2012-09-12 15:44:52
|
Good idea, sad that I can't implement its with alpha  I also understand that’s main time eat work with array, for example Code by link takes 2594962 ns in (for 1000000) Clear for eat 2101255 ns; While simple int pixel = ar_Ints[0]; 3466137 ns in same for And you need three of array access: two for get pixels and one for put back; 5512280 ns Like you see main problem not in math calculation  Thanks all, I really tiered trying optimize rendering at this point its work 9482898 ns =) And give in game 100-300 fps 
|
|
|
|
|
22
|
Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language
|
on: 2012-09-09 18:49:48
|
You are using OOP/extends wrong in that example.
You don't have a firm grasp of bit manipulation and bitwise operators (they can be confusing).
Maybe you right, I don’t say that I am right on all 100% If you can optimize this with bitwise Its really helps my software rendering . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| public int TextureData[]; public void set_Pixel_Color(int pos, int pixel, float r, float g, float b){ int r1 = (int)((pixel & 0x00FF0000) * r); r1 = r1 & 0x00FF0000; int g1 = (int)((pixel & 0x0000FF00) * g); g1 = g1 & 0x0000FF00; int b1 = (int)((pixel & 0x000000FF) * b); b1 = b1 & 0x000000FF; pixel = r1 + g1 + b1; pixel = pixel | 0xFF000000; Texture_Data[pos] = pixel; } |
And this ^^ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| public int TextureData[];
public void set_Pixel_Alpha(int pos, int pixel){ int alpha = pixel & 0xFF000000; if(alpha != 0xFF000000){ if(alpha == 0)return; float a1 = (float)((alpha >> 24) & 0xFF) / 255; float a2 = 1 - a1; int org_pixel = TextureData[pos]; int r1 = (int)((pixel & 0x00FF0000) * a1); int r2 = (int)((org_pixel & 0x00FF0000) * a2); int g1 = (int)((pixel & 0x0000FF00) * a1); int g2 = (int)((org_pixel & 0x0000FF00) * a2); int b1 = (int)((pixel & 0x000000FF) * a1); int b2 = (int)((org_pixel & 0x000000FF) * a2); r1 += r2; r1 = r1 & 0x00FF0000; g1 += g2; g1 = g1 & 0x0000FF00; b1 += b2; b1 = b1 & 0x000000FF; pixel = r1 + g1 + b1 ; pixel = pixel | 0xFF000000; }
TextureData[pos] = pixel; } |
|
|
|
|
|
23
|
Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language
|
on: 2012-09-09 10:48:22
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| ARGB pixel float r_mult = 0.5f; float g_mult = 1; float b_mult = 1;
int r1 = (int)((pixel & 0x00FF0000) * r_mult); r1 = r1 & 0x00FF0000;
int g1 = (int)((pixel & 0x0000FF00) * g_mult); g1 = g1 & 0x0000FF00;
int b1 = (int)((pixel & 0x000000FF) * b_mult); b1 = b1 & 0x000000FF;
pixel = r1 + g1 + b1; pixel = pixel | 0xFF000000; if pixels in byte array then simple (unsigned ^^) Ar[1] *= r_mult; Ar[2] *= g_mult; Ar[3] *= b_mult; Ar[0] = (byte)255; |
Isn't this just the same as calling a method?
Yes but - Function pointers: really good optimize code. It will take long time to explain, and who need explanation, java don’t have them XD You do need to explain. Either make your parent inherit from another object or use interfaces. Interfaces work just as fine and are more flexible. You don't need to (shouldn't need to) make an object extend itself from multiple objects.
Interface don’t have dynamic variables. Example Walk type ground class, and walk class water type, You need rewrite them in new one class, you can’t use 2 parents. 1 2 3 4 5 6 7 8 9 10 11 12
| Class walk{ int speed = 10; int get_Speed_Walk(){return speed ;} } Class swim { int speed = 20; int get_Speed_Swim(){return speed ;} } Class Mob extends walk, swim{ int ground_Speed = get_Speed_Walk(); int water_Speed = get_Speed_Swim(); } |
an unsigned byte and signed byte holds the same data (bits).
If they same why I can’t do them unsigned; why I must do this B & 0xFF to convert to int =) and 1 2 3 4
| byte a = 140; byte b = 10; byte c = (byte)(a / b); 14 == -11 ? =) |
|
|
|
|
|
24
|
Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language
|
on: 2012-09-08 13:33:17
|
Want: 1# Unsigned variables Hate signet bytes, use for unsigned bug with chars (char always unsigned  ) 2# Hate unavailable change some bytes of big variable Like this : int a = 00FF00FF a byte[0] add AA that’s easy do in memory but for Java need separate bytes  int b = a & 0xFF000000 int c = a – b; b /= 0x01000000 b += 0x000000AA; b *= 0x01000000 a = c + b; bullshet =) or simple add to int a += 0xAA000000; but i want add byte not int =) to change RGB color need separate bytes *;* (remember solution, use bytebuffer, get from it vice/versa int[] and byte[], don’t remember why I not using it, maybe because byte signet pf ;S, or it slow, hm) Update(check, bytes signets, and I can’t convert bytebuffer to char array vise/versa, for unsigned byte  ) 3# Want do more then 1 parent for class, interfaces not help some times. (don’t need explanation ^^) 4# Function pointers =)) (or mega insane goto outside functions XD) That’s all i can remember . 5## Also want normal goto, not strange label breaks XDDDD 6## and function for manual delete Objects ^^ 7## and working ASM code (JNI? Hm want integrated code \(^;^)/) @Love in java@ 1# Debuger 2# Compilator (really fast, don’t need wait 5-30 min until compilator find error like in C++ XD) 3# IDE !!!!!!!!!!!!!!!!!!!!!!!!!! it really help find errors =) 4# GC same helps, don’t need think about memory leaks. … and many else 
|
|
|
|
|
25
|
Discussions / Business and Project Discussions / Re: Closed for business - Android vs. iOS
|
on: 2012-08-18 06:36:47
|
I think I understand what can hold ppl from piracy, developers need give them something more then simple game(that can be easily copied), like unlimited access to download game that they buy(steam, minecraft …) online achievements like in L4D, or even characters like in MMO, that’s force ppl to use official games – they will know that they game result (played time) not disappear in any moment (not all want lose achievements 1000 wins, and lose time to receive it again  ), give them hope in next day. p.s And yes Cas free to play games give more income then simple MMO =)
|
|
|
|
|
26
|
Discussions / Business and Project Discussions / Re: Closed for business - Android vs. iOS
|
on: 2012-08-17 03:49:02
|
Using word ”quality” I mean interesting (about games) (you can’t say interesting about quality of service  ) The more interesting MMO game for customers the more time they spend on it before go to another more interesting game(According opinion of the customers) This works well, though there are exceptions for very popular games. Look at Counter Strike scene, the pirated one is so strong it's total alternative to the official one, they do 'official' leagues and clan matches within it.
+starcraft 1, dota(war 3) "iccup" like example The irony is that many ppl using it, even have the official version of the game, and all because there you can find a better opponent than on official servers (quality of service, more interesting)
|
|
|
|
|
27
|
Discussions / Business and Project Discussions / Re: Closed for business - Android vs. iOS
|
on: 2012-08-16 20:16:38
|
I create new story  about content modification Like all know : developers not allow do that. Customer buy apple from trader, and try draw on it Trader “you can’t do that’s I not allow  ” @facepalm Why I can’t change logo in game that I buy(or models)? I pay for it. Because companies not sell game there rather give games(Digital copy) in rent for unlimited time =) Why they fear changed content? Because they fears that someone using they work can create something better then they. Not Buy, Rent 
|
|
|
|
|
28
|
Discussions / Business and Project Discussions / Re: Closed for business - Android vs. iOS
|
on: 2012-08-16 19:34:03
|
Server games can be hacked and setup public pirate server  Evil links wow github.com/mangos/mango add “s” to end =) aion my-svn.assembla.com/svn/aion-em “u” (infesting fast, official Aion server was been pirated during some public tests ^^, so hi have 2 dif public emulators (1 from official, and 1 from crakers)) Diablo 3 skidrowcrack.com/diablo-iii-collectors-edition-full-crack-wai “t”
(all servers with old version of game, with bunch of bugs, but many ppl that’s can pay for official games. play on them, or simple for fun with friend, WoW with 150 lvls ^^) (that’s why ppl crack games – for fun, they don’t do money on them, and even don’t want harm developers)
And many other games .. =)What difference with pirate server, and official, the difference in quality (many quests not work etc…), Even if some one copy 100% you’re server you can faster update it and add new content, that’s holds clients. Its something same as someone create games that’s looks better then yours, ppl go to him and they really don’t care pirate him or not. Its war for quality, who give more quality product holds more clients even without piracy, better say piracy can’t compete with official servers. Other company that create MMO better then yours do in million more harm then pirate server of your game. Like someone smart say ”Do more quality product, don’t stop, and listen what other say to you, and you receive everything what you expected  ”
|
|
|
|
|
29
|
Games Center / Cube World Projects / Re: World of change
|
on: 2012-08-16 17:55:13
|
Thanks for watching the topic(I see this by count of Reads ^^) Sorry I don’t update game, I already do light update render(work faster) and do in game voxel editor for cubes, and terrain generator without hi limit(hi limit in my game 4mil cubs ) =),say truly I do this 5 month ago, and don’t post because shi on new rewrite test engine(for 5 month I rewrite it something like 3-5 time, so now to combine all together need some time  , I work now on 2D Multiplayer FPS/RTS (all this 5 month on same engine), I first create it for test and design AI, but now want finish 2d game, better find all bugs in 2D before go in 3D, also I want test multiplayer, and Mod API.(I rewrite all engine for this, and that’s not end XD) Now do Art for game (lol I spent for it something like 2-3 month, all this time I looking easy ways to do it, but only now I understand that’s art is not important, I can draw simple pixel art then let so bite  , later when have free time and ppl ask me I redraw it ) Here is last screenshot it looks strange(it have some mess on map)I updating sprites   5 month old not realized engine ^^  
|
|
|
|
|
30
|
Discussions / Business and Project Discussions / Re: Closed for business - Android vs. iOS
|
on: 2012-08-16 04:39:52
|
@Roquen There no difference between real and virtual products. You fully right;) I even create couple story’s to show that: Situation #1 Human (A) buy apple from Trader, eat half and give rest Human (B) Trader say”(B) you stealer(pirate) you don’t pay for apple you can’t eat it  ” Situation #2 Human (A) buy seeds from trader, grow up tree take new seeds and give them Human (B) Trader say”(B) you stealer(pirate) you don’t pay for seeds  ” (clone product in real life =)) (yuu may say (A) do work to clone seed, but crack teems same do work to clone and clear DRM) Situation virtual #1 Human (A) buy game CD from Trader, play it 10 min and say ”I don’t like it, do you want try Human (B)” hi answer “yes why not”, (A) give (B) CD ((A) have installed game on PC) Trader say”(B) you stealer(pirate) you don’t pay for CD you can’t use it  ” (If product don’t have DRM, its piracy to share it? And many say yes ^^) Evil True: Now you see what a nonsense stand behind electronic piracy? Same as for intellectual right, for them I create new story Human (A) find apple and grow up Tree, Human (B) also find apple, and want grow up Tree, (A) say ”(B) you can’t grow up apple tree I first grow up it, its my intellectual right, to group all apple trees  ” (Interesting why no one do right for Air, then hi can say “ its my air you cant breathe it”) Its evil, but that’s truth, you don’t pay for program itself developers, you pay them for there work, and not for product itself. And if you don’t like what they doing why you should pay them? They even try hide truth from you. Simple example: Trader Show small part apple(Demo) you like it, buy it, and suddenly you see the another part is rotten. But you already pay for it, why you can’t return you money back? (try find another story, about electronic piracy in real life, I want read it, especially where analogy of piracy is crime =)) In any case if you like work that’s some one do, why not pay him  Update: But like I say before: In any case piracy produce morans which don’t want pay for product in any case or even try make money on some one hard work, and that is back side of coin. This is a situation when a small group of people create bad opinion about all society. We've seen it many times in many different cases 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|