|
Taiko
|
 |
« Reply #360 on: May 18, 2011, 07:01:37 AM » |
|
Yes, exactly. My package can by found at http://pygame.org/project-pyflora-1865-3275.html. You can do a pretty good variety of plants with really simple rules. I'm also working on a stochastic version so you get slightly different variations of the same plant over time. 
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Taiko
|
 |
« Reply #362 on: May 18, 2011, 09:04:54 AM » |
|
Cool! I'll check him out.
|
|
|
|
|
Logged
|
|
|
|
|
Triplefox
|
 |
« Reply #363 on: May 19, 2011, 12:45:18 AM » |
|
Today I added manipulation of multiple tile layers to my level editor. The tiles get converted to box2d bodies at runtime, the idea being that you can differentiate "mobile" bodies and "fixed" ones by using different layers.
Tomorrow I am going to put in the single most complicated feature of my level editor: Adding/removing joints of various types, which can attach to the layers.
Don't look forward to it, but I have a plan to keep it simplified and in preset-land, not "omg sliders everywhere."
|
|
|
|
|
Logged
|
|
|
|
|
Skomakar'n
|
 |
« Reply #364 on: May 19, 2011, 01:03:49 AM » |
|
Today I added manipulation of multiple tile layers to my level editor. The tiles get converted to box2d bodies at runtime, the idea being that you can differentiate "mobile" bodies and "fixed" ones by using different layers.
Tomorrow I am going to put in the single most complicated feature of my level editor: Adding/removing joints of various types, which can attach to the layers.
Don't look forward to it, but I have a plan to keep it simplified and in preset-land, not "omg sliders everywhere."
Sounds like a good situation for a linked list to be used, at least. My game is also a Box2D game, for which I have programmed a custom level editor. My layer system is quite smart, in my own opinion, haha. Every type of object belongs in a 'layer priority group'. Different types of objects can belong to the same group. Objects belonging to group 1 can't be placed in layers below objects of group 0, and can't be placed in layers above those of group 2, for example, but objects within the same group can be freely moved above or below each other in the layer list. This makes it very easy to make sure that objects that have to be drawn in a specific order are drawn in that order, without any errors, as they're not possible to make. No type of object can be placed behind a background house, and no background house can be placed in front of anything else; they're automatically moved to the top layer of their group when they are added to the world, and can then be moved up or down.
|
|
|
|
|
Logged
|
|
|
|
|
Dacke
|
 |
« Reply #365 on: May 19, 2011, 03:42:53 AM » |
|
compile and run this in c++ #include <stdio.h> #include <time.h> #define O_O const char* #define __ if #define ___ while #define OO void
O_O O[]={"$%&'(#)*+,-./0#1234567#)89:;<=>#","0?@ABC5D#EFBG#", "HIJBK#HILBM#HINO-PB#HIFBQ#HIRS#HIATU-VB#","WXY=Z.[#\\]^_`#abc'Rd#efg*h^ij#k*+l-mInd#opBqrC5D#" ,"sJBK#sJBK#HIJtIJ#uBK#HIJtIJ#uBK#","WXY=Z.[#\\]^_`#abc'Rd#efg*h^ij#","\n","I;y.;","21","-,.?29;.-",",1","41*;", "G1+","521)",",8;",".+4;-","?2<","-1","<1","W","_",":+44","=1337,3;2,y-",")8?," ,"Wy3",",8725729","1:",")1+4<2y,","9;,",",87-",":.13","?2'","1,8;.","9+'","6+-,", ")?22?",",;44","'1+","81)",":;;4729","Y1,,?","3?5;","+2<;.-,?2<","R;*;.","9122?", "97*;","+0","4;,","<1)2",".+2","?.1+2<","<;-;.,","=.'","-?'","911<>';","?","47;", "8+.,","I;y*;","521)2",";?=8",":1.","4129","G1+.","8;?.,y-",">;;2","?=8729",">+,","G1+y.;", ",11","-8'","7,","W2-7<;",");",">1,8",")8?,y-","91729","12","I;","9?3;",");y.;","04?'","_2<", "7:","?-5","3;","Q111111118rrr","2;*;.","Y7*;"};OO _0(float _){clock_t _O=clock() +_*CLOCKS_PER_SEC;___(clock()<_O);}char _O(char _){__(_=='\n'||_==' ')return _;return -(_-'#'-'}');}OO __O(O_O _){___(*_){putchar(_O(*_++));fflush(stdout);_0(.06);}}OO _(O_O _){___(*_){__O((O+6)[*_++-'#']);__(*(_-1)=='#')_0(1);else __O(" ");}}int main(){_(*O);_(*(O+1));_("#");_(*(O+2));_("#");_(*(O+3));_("#");_(*(O+2));_ ("#");_(*(O+2));_("#");_(*(O+4));_("#");_(*(O+5));_(*(O+1));_("#");_(*(O+2));_("#");_(*(O +2));_("#");_(*(O+2));_("#");}
(i was quite bored) I really loved this so I ported it to Python, with the goal of making it even more compact. (But far less obfuscated obviously!) Your version is much more interesting, but at least I learned some new things about Python. Run as Python: import zlib, base64, time, sys for c in zlib.decompress(base64.b64decode("eNrtlL1uhDAQhHueYjq6e4erTjRJeUppYMEOxnvyzyHePmvgEpGT0kSK\ ckqoLM96/O2OxZlKT3CMEL1yPfmAyLB8JRQvnDA4nhA1wSdLAcq1CIyWUaE4okvWouFxNHEkF8uASauIqhzljHGDcT24W50mTrZ\ 1ZURPMasBnedRHGew\XODRpxlFhdcUIiblnEIksZ/lrBaIbNoR2exZnDhGhVENtOjJtUIeM11RPNE1u3F26M11q7hgJ1iByPstT\ 26v+OSgPIvl0m1Lgfxauyt7v7vx814JapYVt/VMe2FpR642tDjrdPMtzlQKZ561A6lGbxPp2OdpW84tyww9NCmfx1wTCWWj8zDq\ FBc1BxlZktRzzjBjGFEqF0xLmAi1uK6B5p\RuLj0vKckUzvQRd6/GlXJaHsjawMVunkcRTLfAqzBASu8SesQYHhD5mbdPHw6HPf\ QX0l2j7vNGcfpO/S950H/zZ/KP/BPIb0L/fvg=")): sys.stdout.write(c);sys.stdout.flush();time.sleep(0.06) if c=='\n':time.sleep(0.94)
|
|
|
|
« Last Edit: May 19, 2011, 04:14:21 AM by Dacke »
|
Logged
|
vegan • socialist • atheist • humanist • liberal • FOSSer programmer • feminist • animal rights activist • pacifist • teetotaller
|
|
|
|
Dacke
|
 |
« Reply #366 on: May 19, 2011, 01:28:03 PM » |
|
Okay, so I went a bit overboard with this. I wrote an image to ascii converter in python to make it work. Run as Python:import zlib as a, base64 as b, time as c, sys as d e=1;f=a.decompress(b.b64decode("eNrtWslu3DgavuspCBSQ3AgQPBAgT31q5TJzDPpYieVlYpca5XIMv33/GzeJlMqeDDC\ NGcaJKyXVV/++6uv0+Typ06yeL+fj6W46P6vLrB7nn5Ma/phf1I/T/Kou95M6vzxOz+p4ulHPs7qZ1Rc1/KZuXx4f1ff56enh8j\ SdLp+f1ev98aK+fH6Czzycfjyc7tR8y0iv88vjzenzRd1NF7z6rG7P8xMgvqkZvuCs7l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m8UufY9GbYEuPX8Eq93fVcpzbebNWI0eSOR0ndk2IDT2bwlbcYHXEzeHrQ10\ 5BhJIYLGK4UyrlKBszq9lsyFNmxq6aSK4EavdiX+pUMVYvjXGAxmJNyxPJcOHuNv4Zl8noKfVyw8kSDKlCQpC4Bxed1rDNadsjm\ a0fHUR9bFyTO8ByZpdj17kHqwJXNGOTVahoj4aaA5mc28tyNHQLYINEkAUqOKI7aiEXNaENPBmSlhNFQR2CpUrK8oNsAXEcaE/S\ YEpIljjkx04YOcd8JaBEP2cW/uKcYS9NGf9lheSVE+EQyQvC+oHkzlcoR+15AbUaqOtIsHfIT/VipO3eVsgqJlCcdeYkTo4kVWN\ gF1O0Q5sSTUSXsInHqugmoVRsOEgpZn+O9AncnqJDg9yhsEShTLsdrGpOeksF1jL9Ghrohw5RCYqBGnrW6AnBdNrSGZuTbSl0Fq\ HY38vJctauD6xbLym+u9+24ehh6Uyk7zwqg2zhMUbqVopeAXtqvLTiaqRtwws7zHxXg3iyP/EQssTdJXMlwa0Ym+uBOuTte1VcC\ cmq2QqLZmnVeBzi6SCHFVbc5Pb0KkPaYjhuy/T34VYCIFOsGvY847IsQN7o2jONVA2o/DH8BVTNC1w==")).split("&");l='' d.stdout.write(f[e]+'\n');g='\n' for h in f[0]: if h==g==l:d.stdout.write(g+f[e%5+1]+g);e+=1 d.stdout.write(h);d.stdout.flush();c.sleep(0.06);l=h if h==g:c.sleep(1)
|
|
|
|
« Last Edit: May 19, 2011, 01:45:02 PM by Dacke »
|
Logged
|
vegan • socialist • atheist • humanist • liberal • FOSSer programmer • feminist • animal rights activist • pacifist • teetotaller
|
|
|
|
Triplefox
|
 |
« Reply #367 on: May 19, 2011, 01:57:09 PM » |
|
Sounds like a good situation for a linked list to be used, at least.
My game is also a Box2D game, for which I have programmed a custom level editor. My layer system is quite smart, in my own opinion, haha. Every type of object belongs in a 'layer priority group'. Different types of objects can belong to the same group. Objects belonging to group 1 can't be placed in layers below objects of group 0, and can't be placed in layers above those of group 2, for example, but objects within the same group can be freely moved above or below each other in the layer list.
This makes it very easy to make sure that objects that have to be drawn in a specific order are drawn in that order, without any errors, as they're not possible to make. No type of object can be placed behind a background house, and no background house can be placed in front of anything else; they're automatically moved to the top layer of their group when they are added to the world, and can then be moved up or down.
That's not the problem at hand. I already have layer drawing and ordering in place so I can draw them reasonably well. Everything is generated from tiles for simplicity; it was kind of a pain to render tilemaps so that they line up and rotate correctly with the physics objects, but that was done, and done weeks ago. The only feature of core gameplay that I haven't really tested is applying bitmasks to different layers so that they can go above/below each other. But to get to the problem. It's all UI: the user has to know which layers they're connecting when they work with joints, since each layer turns into a body at runtime. If I do this wrong it will be too confusing for public consumption; just having layers, by themselves, presents a usability problem. This is why I used tiles to begin with; it makes that stage of construction easier, since things will all line up neatly. That said, I do want to have an explicit notion of joints and layers, since they open up so many possibilities. So my solution is: Stick to a small, fixed, pre-ordered number of layers(right now 4, maybe more in the future). Adding a joint is in three steps: 1. Place start of joint 2. Place end of joint 3. Dialogue pops up: Which layers are being connected, and what kind of joint is being made? Then you see a placeholder graphic for the joint appear on the map saying "1-->4" or whichever layers you've connected. I haven't finalized how I'm setting the mass of layers yet, but I will probably end up using a per-layer control, with the first layer always being fully static, since I use that body for the borders of the map as well. Combining mass, masking, and joint variations should make it possible to do some interesting over/under/rotation situations, but the biggest issue is in making sure that the user naturally ends up with valid/interesting combinations. One idea I might run with is having not just a preset _number_ of layers, but preset _classes_ of layer: "Ground", "Low/Medium/High Obstacle", "Tall". That would greatly simplify things.
|
|
|
|
|
Logged
|
|
|
|
sublinimal
Level 6
"It's kind of hard to explain."
|
 |
« Reply #368 on: May 20, 2011, 11:28:45 AM » |
|
 Fibonacci spirals with a random palette generator!  Recursion trees!  A futuristic faux-3D landscape that's actually half of an ellipse! Could make a neat setting for a racing game. Okay, nothing impressive, but at least I did it all without any help. These damn .gifs don't seem to move smoothly at all, although they only have like 1 ms delay between the frames.
|
|
|
|
|
Logged
|
|
|
|
|
Dacke
|
 |
« Reply #369 on: May 20, 2011, 11:34:46 AM » |
|
That's really neat! The tree animation is lovely.
|
|
|
|
|
Logged
|
vegan • socialist • atheist • humanist • liberal • FOSSer programmer • feminist • animal rights activist • pacifist • teetotaller
|
|
|
|
beyzend
|
 |
« Reply #370 on: May 21, 2011, 12:05:01 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
_Madk
|
 |
« Reply #371 on: May 21, 2011, 01:04:54 PM » |
|
 Perlin noise for terrain generation
|
|
|
|
|
Logged
|
|
|
|
|
xhunterko
|
 |
« Reply #372 on: May 21, 2011, 02:33:56 PM » |
|
Currently, the apocalapse.
|
|
|
|
|
Logged
|
|
|
|
|
_Madk
|
 |
« Reply #373 on: May 21, 2011, 05:47:10 PM » |
|
Working on improving the RNG behind my perlin noise. This came up: 
|
|
|
|
|
Logged
|
|
|
|
Ludophonic
Level 1
|
 |
« Reply #374 on: May 21, 2011, 06:09:17 PM » |
|
I previously rewrote my OpenGL stuff on Windows to be OpenGL 3.2 Core Profile. Now I'm backporting that to work under OpenGL 2.1 + extensions on OS X.
|
|
|
|
|
Logged
|
|
|
|
|