doci
Junior Member
Posts: 19
|
Post by doci on Jun 11, 2007 10:40:01 GMT
Hello all, I see that development of the game isn't going very fast and I see that you have good spriters/tilers or whatever The thing is that some time ago (maybe a year ago) I was working on a pokemon fangame. So I decided to continue and I would like you to offer some of my help. Well, I have really good skills on programming with C/C++/ObjC/Java and I've created a tile based engine designed specifically for pokemon game. But last year I've dropped that project and now I decided to rewrite that engine in C++ mixed with ObjC (objc is really useful when it comes to events). And I am working on editor right now (Qt4 based). Here's some brief engine features: * C++ with ObjC based (means that it's much faster than Java) * Embedded ruby scripting (means that's very easy & fun to write game scenarios) * Software gamma (means that it allows for nice & smooth daytime change) * Has some base support for networking (means that in the future online-game could be implemented) * Engine can import maps/tiles/blocks/palettes/pokepics (mini-pokepics too)/pokecries from various GBA roms * Many more So if combined your spriting/mapping skills and my programming skills we could make a good pkmn game.
|
|
|
Post by FMY on Jun 11, 2007 18:17:56 GMT
That engine seems great, but we already started making our own in Java ( JEPE). Your engine is currently further than ours, I guess, but I still don't feel like abandoning it. However, maybe we could share code?
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 12, 2007 8:12:56 GMT
Sure.
But keep in mind, that everywhere I have my own formats. For example: I am still using 8x8 based tiles, but with 256 color palettes. Each block (16x16) is build from 8 tiles (2 layers). Each tile has it's own palette. I kept palettes for that reason that it's easier to deal with season changes or something like that. I currently have imported: * tile data (small 8x8, 256 color pictures) * block data * poke pics (64x64 pics, with 2 palettes: shiny and normal) * mini poke pics (16x16 pics also with 2 palettes) * poke cries (8-bit if I remember correctly). I can export pokiecries directly to wav files. * maps (map is just a two dimensional array of block index numbers. Techincally it's one dimensional array) * map-headers (header contains map index, weather, map connections, events, like people, warps and so on. )
Because I saw that you are using PNG's with XML's. Thats really unefficient. I am just thinking how you are going to implement overlapping. For example: player (or any other object) moves behind a building. And how do you know which part of object to draw ant which not? This is one of many problems I've ran while working on this project. Of course, I've fixed this quite easily, because as I mentioned, I am using TWO layered blocks.
I am using RAW file format. It means that this is the most simple format possible. It's easy to load (statically or dynamically). Also files are small enough. All data from pokemon ruby is about 10 MB. But still it's not cleaned.
My engine also supports dynamic map loading: it allows to cross from one map to another transparently. Just like in a real GBA game.
Also I've implemented several weather effects and what's the most good - transparent day/evening change. I am using gamma correction, so it allows to create really realistic felling that's morning or something right now.
I am using libSDL, so the engine is cross-platform (I am using OpenSUSE linux right now).
Some other rendering details:
The engine creates an empty array, to which compiled blocks are stored. When you enter a map all blocks, which YOU SEE are compiled to 16x16 32-bit pixmaps, which are rendered to sub-buffer. Then the engine draws sub-buffer with gamma effect directly to screen. After that weather effects are aplied (rain, snow and etc.)
The engine also uses freetype2 (directly) so I can use any font I want.
I can give you the old source-code, because the new one isn't quite complete. So I plan to make huge progress in this summer (it's holiday for me now, so I've got plenty of free time).
Well, suit yourself. But of course, my game (or engine) will have a fully integrated editor. So you will not need much coding skills, just ruby. For example:
def Some_object_1234.action(); msg_box("HI"); if (question("Do ya want this?", QST_YES_NO) == ID_YES) giveitem(ITEM_SOME_BERRY); else msg_box("Go away"); end; end; Quite easy, isn't it?
Of course, there might be problem importing tilesets, which are posted in your forum, but I'll think something. Maybe I'll use SDL_Image to load images and then I'll write something to palettize them and to store them as 8x8, while removing same tiles.
So, I am *really* open for suggestions or for some team, which could help me with tilesets/maps.
Map import from XML is also planned, so if you are using "Tiled" map editor, it will be possible to import those maps you've created, but soon I'll release my own maps editor (map/tile/block editors first, then header/pokedata/scripts and etc.)
|
|
|
Post by BonzaiRob on Jun 12, 2007 12:32:59 GMT
That's finished, items are drawn in order of their Y attribute (or more accurately, that of the collision rectangle). That Charizard NPC is a little oversize, so its nose is touching the other tree. We're about to change our map syntax slightly to allow extra layers on top and below. As for the rest, it sounds very impressive, but you've either been working longer or are just faster than us XD Any source code you'd be willing to commit would be much appreciated. And we're not using tilesets as such, all the files are split up; much, much easier to create new objects this way. Static tiles are 16 x 16, and objects can be any size. They are given collision data in the XML map. Oh, and PNGs come with automatic gamma correction; palettes are far too complicated. Here's an example of loading an object in our system: <object image="house.png" x="10" y="7" recty="1" rectheight="2" /> This would be for a 4 x 4 tile house. image, x and y are obvious; recty is where the collision starts (in this case one tile down from the top), and rectheight makes sure the rectangle doesn't stick out of the bottom. In the tree above, it has two tiles in from the top and one in from the bottom - recty="2" rectheight="3" (it's 6 tiles tall). Also, the Charizard above. He's bigger than 16 x 16, but he works as a normal NPC would. That sort of flexibility is why we're not using all tiles or tilesets. Feel free to visit the JEPE site, and you can download our SVN if you want to see what we've got. We haven't updated this forum, and there are a lot of old misleading topics. Just remembered, I think Thief mentioned Ruby. Perhaps it would be worth including that, because your scripting system looks nice and simple. We're using Java because it's completely OS independent; we could make this game for a cellphone if we wanted to. It's a myth that Java is slow, it's displaying large images that slows it down; all our images are small, apart from the title screen background.
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 12, 2007 12:46:03 GMT
Well, I was working on this project for some time, but I dropped it. Now I am rewriting everything, because I really like when everything (the code) is perfect. Well, I use sprites for objects, which are not tiled. Also sprites can be up to 256x256 (yet). For objects, I am using so called block-arrays. Each block array is simply reordered tileset. So you just click a building on a editor, and you can add it where you want. And about scripting engine with some history I dropped my old project at that point when I had to implement scripting. Then I wasn't aware of embedded ruby or other scripting languages. But soon I'll add it to my new project There's only two things that I can't rip: * Animations. And I am not sure from where I can take these. It looks like that each animation is hard-coded or something like that. * Music. Very difficult to rip/play. Just a waste of time. So I am thinking to use Sappy (this one can rip music from Ruby/Sapphire) and to convert it to mod or xm. I don't like midi's, because midi files are very heavily hardware dependent. So about the code. If you have Skype, you can find contact "XWinis" and I'll send the src to you.
|
|
|
Post by BonzaiRob on Jun 12, 2007 12:47:31 GMT
I've managed to rip animations just by taking multiple screencaps on an emulator
|
|
|
Post by FMY on Jun 12, 2007 14:30:04 GMT
If you really want to know it, go here: shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gpp&lang2=javaJava isn't that much slower than C++ is, like you said, but it still is a little slower. About 1.5 - 2 times average. When I first started programming the engine, making the player go behind the objects was indeed a little hard, but it was possible by using my system and really, I think this makes a map creator's life a lot easier now. When I read your post, doci, it seems like a lot of things are incompatible with each other, but I'm certain that we could learn a lot from the "import maps/tiles/blocks/palettes/pokepics (mini-pokepics too)/pokecries from various GBA roms" feature. However, the radically different way of storing images we're using will make sharing other functions hard I think. For the scripting: it shouldn't be hard to implement that in JEPE either, since Java has native scripting support. I don't know exactly how it's working, but I guess it's not that hard to use, and I know it's got support for Ruby too. And here's a reason for my late inactivity at JEPE: I've got exams and a deadline to catch for a commercial product I'm developping. That should be over next Thursday however, so I should be able to get back to work then. I'll add you to skype doci. OFFTOPIC: Great! Another linux user!
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 12, 2007 18:31:56 GMT
Yes, java isn't very slow, but when it comes to software tile/block rendering or gamma correction plus some weather effect and all is running ~40 fps. So I am not sure if my pc and java could handle such amounts of processing power. But with c++ everything runs just perfectly (even dynamic map change does not lag). Object overlapping for me was actually quite easy, since I am using RGB32, so the last byte is unused, so I know which pixel is over player/object and which is under. But here is a thing: I am working on this project alone and I am using C++/ObjC which is supposed to be harder than Java. Just a thought And about import/export: since I am using Qt4, the project improves really fast. So I think that I'll add some XML support or I'll just merge ruby to editor too. So you will be able to write simple export script to export to any format you want. And good luck with exams Do not make any mistakes at all!
|
|
|
Post by FMY on Jun 12, 2007 18:52:54 GMT
I guess you're right about that, but we'll have optional hardware acceleration in the future. On my PC the game runs with 95-101 fps (I set 100 as the maximum) when running a lot of other apps, so for me it's largely fast enough. However, I've got quite a fast PC, so it's possible that the game runs slower on other PC's. As I said, we're going to activate hardware acceleration in the future to speed things up.
Wohoo! Great!
By the way, are you going to release the project under an open source license? That would really be awesome.
Thanks.
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 13, 2007 8:56:27 GMT
Yes. It will be open source. While in development stage, the engine stays half-closed-source It means that if you want you can contact me with skype and I'll make a snapshot. In other words I just won't put it to hosting while it's not complete. But I think that I'll release some preview betas to make the life more interesting
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 13, 2007 17:03:56 GMT
Here's the first editor screenshot
|
|
|
Post by BonzaiRob on Jun 13, 2007 21:22:01 GMT
Have you got any screenshots of the different times of day? That would be interesting to see. We'll most likely be doing it with filters (semitransparent PNGs) and possibly tile/object recolouring. Definitely so with water.
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 14, 2007 8:41:32 GMT
Late night: Early morning: Morning: Before mid-day: Evening Plus you see everywhere rain effect which was made using same gamma correction. There are many more stages, but I am having my exam in three hour so I must repeat a bit. And the daytime is changing very quickly (so I could better see how smooth and realistic change is; just for debugging and testing)
|
|
|
Post by Tropiuslover on Jun 14, 2007 11:57:50 GMT
I like it, especially the morning.
|
|
|
Post by FMY on Jun 14, 2007 12:15:42 GMT
Nice features, I don't like the colors that much, but the thing itself looks very good. We really need to catch up with you .
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 14, 2007 12:19:20 GMT
Thanks for the comments
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 20, 2007 11:29:04 GMT
Yay! I finally reached the old level with new engine. I also added updater, which updates screen both with gamma and with alpha correction. It slows everything down a bit, but that's not a problem (under 40 fps CPU usage is ~1 %; without fps limiter, max fps is about 700). So with that alpha correction I implemented thunderstorm. Looks really nice Now I am working on proper map object processing. This part really sucks, because I need to decide how to draw objects, update them and add some movement to them as well (every object must have a sprite, if it hasn't then it's event, not an object). My idea is when loading map header (that's where object data is stored), load these directly to so called OAM, where game data of objects is stored and where player lives Then sort using quick sort and etc. For object movement I use function pointers. I am really open for suggestions on doing this, because my current object handling system isn't perfect (so called OAM). Maybe you have some good ideas on implementing this? BTW.: how were exams?
|
|
|
Post by FMY on Jun 21, 2007 7:45:55 GMT
Still not finished. I've got 2 left for today (oral ones) and then it's finally over (though I won't be able to work on JEPE before sunday, got some othe business to take care of before).
Well, we don't have objects with actions yet (we doe have moving ones, but you can't do anything else than bump into them), but we'll probably do it like this: All objects of the current map are in an arrayList (Vector in C++, as far as I know), and every one of them has an "update" method, wich tells us what it should do (move, talk, jump, disapear, etc). We check every one of them and see if it's got to do something or not and then do it. That's all.
To limit the movement, we would use rectangle area's (I don't think we need other shapes for now), and to detect if a player is passing in front of a trainer, we would be doing something like:
if(this.getDirection()==LEFT){ if(this.getLeftX()-player.getRightX())< MAX_DISTANCE_BETWEEN_TRAINER_AND_PLAYER){ player.fight(this); } //same thing for other directions
That's for the trainers of course, but that's an object too.
Function pointers sounds like a good idea for C/C++, and I'm sure your way will work. I don't know what OAM is, by the way, and our way isn't perfect either (every object on the current map has to be checked!), but well, that's what I was planning to do.
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 21, 2007 14:56:33 GMT
Well, my idea is quite actually same. Implement actions to objects is quite easy since I use embedded ruby, so there's no problem. I use pointer to function which is called 'sig0'. Before drawing sig0 is executed. Then map is drawn. After map objects are drawn as well using 'virtual' function draw. It's same for all objects because objects have a field called 'current sprite' and 'current sprite frame'. So drawing is done automatically. The only two problems I am facing now is: 1) Loading (I just haven't got any time to think about it a bit deeper) 2) Event queues: how object should now what to do next? For that reason I am using 'sig1' which is called immediately after sig0 finishes it's job. So sig1 should select something. But still, it's very limited because I have to write a lot of functions in raw C++/ObjC. Because I am writing 'engine' so ruby must get as much power as possible to do one or another thing. BTW.: OAM is just a name of my object system. Nothing more. I took it from GBA, where OAM stands for Object Attribute Memory, I guess. For example sig0 is OAM_Moving. It means that object currently is moving to direction which is stored inside that object. In each frame a normal object moves 1 pixel (there are some faster too, like 8 pixels per frame). So when object finally reaches next field, new coordinates are assigned to it. And then it calls 'sig1' which should select what to do next. Just I am not sure which is the best way to do this. An old idea of mine suggests me that I should store these functions to array. Like: event_queue[] = { OAM_MoveLeft, OAM_MoveLeft, OAM_MoveDown } And: int OAM_MoveLeft() { current_direction = LEFT; sig0 = OAM_Moving; return sig0(); } I just haven't decided what to choose
|
|
|
Post by FMY on Jun 21, 2007 23:39:10 GMT
Well, I don't really see what's wrong with the array method. Why don't you use that?
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 22, 2007 11:22:54 GMT
I am not sure yet ;D I just want to find the most perfect way how to do this. I think that I'll use the array method. And yesterday a great idea popped into my head: To use signal & slot system for events. For example: there are some objects which move to opposite direction of player. So I just connect PlayerDirectionChanged signal to ChangeThisObjectDirection slot and when player changes direction, so does player. Then I connect PlayerMoved to StartMoving and when player moves, so does the object. So this functionality is really useful and easy to implement. Also this can be easily accessed from ruby. So I can call this idea as 'perfect' BTW.: yesterday I solved 11x11x11 rubik cube (with PC; there are no 11x11x11 in reality, because it just falls apart; too expensive and too hard to make one) Here is my collection: tux.ptreasures.net/pict1831.jpg
|
|
|
Post by FMY on Jun 22, 2007 12:41:10 GMT
Looks like you're a fan. I've got a rubik cube too, but I've never finished it (I don't even know where it is now, actually).
Anyways, I don't really didn't know how signals and slot work. After reading some about it however, I must say it sounds good. It might indeed be good idea.
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 22, 2007 13:24:38 GMT
Here's basic signal & slot scheme: Lets say we have three functions: void func1() { puts("I AM FUNCTION 1\n"); } void func2() { puts("I AM FUNCTION 2\n"); } void func3() { puts("I AM FUNCTION 3\n"); } And we have some class: class some_class { XSignal signals; void do_something() { signals.emit(); } } Then we can do this: some_class object; object.signals.connect(func1); object.signals.connect(func2); object.signals.connect(func3); Then if object calls do_something then it calls func1, func2 and func3 and the output is: I AM FUNCTION 1 I AM FUNCTION 2 I AM FUNCTION 3 This is just a basic idea
|
|
|
Post by FMY on Jun 23, 2007 13:38:53 GMT
Oh, well, that's nice indeed. That way you could let people write their own functions, which they can simply connect to the object. Looks very nice.
|
|
doci
Junior Member
Posts: 19
|
Post by doci on Jun 23, 2007 18:04:25 GMT
Yes. Exactly. And there's more: I can connect signals not only to functions, but to object methods. So I can create something like class ORubyInvoke { string ruby_command; void do_something() { RubyEngine.execute(ruby_command); } }; ORubyInvoke invoker; invoker.ruby_command = "msg_box('message from ruby');" player_pressed_some_sign_signal.connect(invoker, do_something); Of course, this is just a brief example. The real syntax is a bit different, but since in my engine there's a lot of ObjC so I think that these examples will be more understandable to java programmers So in this way I can 'cross-connect' signals from ObjC/C++ to ruby. And in Objective C it is possible to retrieve method pointer, which is used to connect signals, by name (something like: lookupMethod(some_object, "method_name") ). So I can connect things from Ruby. And this is extremely useful both in engine and in game development with ruby. And some of current development status: I dropped the editor for temporary time. I need to make engine look like a game. In other words I need to think about all formats, things and etc. which are used in the game. And when everything will be stable I will continue working on the editor. For now I am working on the tux11 library, which is used to create the pokemon engine, which will be used to create the final game. Currently I am trying to implement vector graphics engine to tux11 (using agg; antigrain). The main purpose for this is to draw various high-quality graphics. For example: text (ttf fonts are just a bunch of curves and points so we can set any font size we want and the font still looks ok, not 'pixelized'). With this I also will be able to draw rotated text, text with effects, some pretty shapes. And all this stuff will be used to create nice game menus After this little (it's not quite little ) thing I'll continue on the engine. Then the game api (ruby) will be written and after that I'll release some technical engine preview-demo for you to see of what the engine and the game will be capable. But of course I'll soon have a little bump in development since I am receiving a new laptop (dell xps m1710). And I will have to move all my files, projects and other data to this laptop and another two external hdd's (each hdd is 1 TB). So the development will probably freeze for a week or so.
|
|