I have been working on a game for a over a week now(an Crayon clone), and i so far evrything is working great.
however, i have finnaly arived to a part im not entierly sure how i will solve... i have a few ideas, but but thay all have problems wich might not work very good in this game (performance wise).
I'm currently only drawing the vertexes used by the chipmunk engine, however... i have always wanted to create some sort of realistic crayon brush or other type of pen or water color, now... this couses a few problems, becus it is not only one background surface im drawing on.
now, if we where only drawing on a static background, this would be very simple to do... however, things are a bit different now :S
Oky, so here are the problems.
1. Since we dont know the total width+height of the shape we are drawing until we have finnished drawing with the brush, it is hard to create an image, also... creating on the fly, half the screen in size(for example) seems slow(?) and will hit the framerate.
2. even if i break things down to small blocks, we dont know how many we need to allocate in advance. and even if i where to pre-load tons of blocks to be used later, then we would have a limit in the number of shapes until we need to create them on the fly again, and then we would have a slow-down when we hit that limit.
im not sure if im explaning my self very good or not :S
to summon up, we dont know how many Images to allocate in advance, we dont know the finnal width and height of our shape(so we cant create one big image when we are finnished, and if we do, that might be to slow for realtime).
we are creating tons of shapes, and it dont seem good for the performance to create a new image on the fly for evry line drawn ether.
however i turn this around, i seem to get to the same problems... so, does any one have an idea how thay would solve this?
I relly Relly dont want to draw a simple line from dot to dot, a custom brush would be much nicer for a game like this.
[edit2] im leaning towards creating tons of small images in a list, and access them when i draw outside my current grid of images
but if any one knows a bether solution, im all ears. :)
however, i have finnaly arived to a part im not entierly sure how i will solve... i have a few ideas, but but thay all have problems wich might not work very good in this game (performance wise).
I'm currently only drawing the vertexes used by the chipmunk engine, however... i have always wanted to create some sort of realistic crayon brush or other type of pen or water color, now... this couses a few problems, becus it is not only one background surface im drawing on.
now, if we where only drawing on a static background, this would be very simple to do... however, things are a bit different now :S
Oky, so here are the problems.
1. Since we dont know the total width+height of the shape we are drawing until we have finnished drawing with the brush, it is hard to create an image, also... creating on the fly, half the screen in size(for example) seems slow(?) and will hit the framerate.
2. even if i break things down to small blocks, we dont know how many we need to allocate in advance. and even if i where to pre-load tons of blocks to be used later, then we would have a limit in the number of shapes until we need to create them on the fly again, and then we would have a slow-down when we hit that limit.
im not sure if im explaning my self very good or not :S
to summon up, we dont know how many Images to allocate in advance, we dont know the finnal width and height of our shape(so we cant create one big image when we are finnished, and if we do, that might be to slow for realtime).
we are creating tons of shapes, and it dont seem good for the performance to create a new image on the fly for evry line drawn ether.
however i turn this around, i seem to get to the same problems... so, does any one have an idea how thay would solve this?
I relly Relly dont want to draw a simple line from dot to dot, a custom brush would be much nicer for a game like this.
[edit2] im leaning towards creating tons of small images in a list, and access them when i draw outside my current grid of images
but if any one knows a bether solution, im all ears. :)