blendman's Forum Posts

  • Hi Arima and Newt.

    Thank you very much for your answers

    > I would like to know if it's possible to create a 2D software with construct, like photoshop elements, or a painter lite (not with all of the fonctionnality).

    >

    Yes, you can. I've made one myself. You'll want to use the canvas and image manipulator.

    Thanks.

    I have see the canvas and image manipulator. They have a lot of interesting features.

    But I haven't found some others like :

    • change or modify/copy the alpha of the canvas (alpha channel)

    The alpha of the canvas is or isn't premultiplied ?

    [quote:2vk0f3i6]

    - it is possible to create a sort of "windows" menu, at the top of the application (file/edit/iamge/view..) ? I have tried to add a "menu" but it doesn't work.

    You have to make your own, such as with sprites or text objects.

    ok, but what is the "menu" option, under "window propertie" ?

    We can add some menu and submenu, how can we use it ?

    [quote:2vk0f3i6]

    • for painting, we have to use the canvas ? Is there some informations about the utilisation of the canvas (blend mode, draw a sprite on the canvas..), because the page for the canvas on the wiki is empty ?

    he way I did it is by pasting the brush sprite to the canvas.

    Yes, it works fine .

    I have seen that we can paste a lot of things on the canvas, particles too .

    [quote:2vk0f3i6]

    I'm looking for informations about sprites and canvas transformations too :

    • sprites : size, scaleX/Y, rotations, opacity...
    • canvas : opacity, transformations (resize, stretche..), cut/copy/paste, save..

    That info can be found in the wiki, on this page in the 'common' section: http://sourceforge.net/apps/mediawiki/c ... ite_Object

    One thing to watch out for is the image manipulator returns an incorrect value when retrieving the y position of a pixel. It's both upside-down and misaligned.

    erhap's it's more easy to change the size of the drawing sprite .

    Yes its possible, but its a pretty contrived process.

    There's a ton of stuff you have to take into account on every little thing you do. Stuff like reading from the gpu, relative coordinates, no existing menu system, and canvas...has a few issues.

    It's even possible to do some layer modes, but its not possible to add them on the fly.

    Same goes for the particles object, it will paste into the canvas, but you cant change the texture during runtime.

    es, I have seen that the canvas has got some bug.

    But, I hope they can be resolved .

    Some questions :

    • can I change the width/height of a layout with code ?

    when I maximise or change the window size (with the mouse), the canvas is very buggued, is there a solution to resolve that bug ?

    Thank you.

  • Hi

    I would like to know if it's possible to create a 2D software with construct, like photoshop elements, or a painter lite (not with all of the fonctionnality).

    So, I'm looking for informations on creating a 2D painting software with Construct (tutorials, examples...) :

    • dis there a general tutorial on how creating graphic application with construct ?
    • it is possible to create a sort of "windows" menu, at the top of the application (file/edit/iamge/view..) ? I have tried to add a "menu" but it doesn't work.
    • for painting, we have to use the canvas ? Is there some informations about the utilisation of the canvas (blend mode, draw a sprite on the canvas..), because the page for the canvas on the wiki is empty ?
    • it is possible to create some windows pop up for options (like brush parameters, or adjustement layer...) ?

    I'm looking for informations about sprites and canvas transformations too :

    • sprites : size, scaleX/Y, rotations, opacity...
    • canvas : opacity, transformations (resize, stretche..), cut/copy/paste, save..

    I think I will use particles as a paint tool too, in this application.

    I have read soms threadsabout paint with construct, and found some examples, but, perhap's there are other int?resting example or tutorials .

    Thnak you very much if you have some of theses informations.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • great ! Really, really great

  • Great, thank you .

  • Linkman2004 : Thank you for your answer. And sorry for my example. itwas very bad when I re open it. Thank to you I have understand how does work the repeat and for each object event.

    Thank you for the example.

    Newt : thank you for helping me. Your example is very interesting too. It reminde me some GML code. Thanks !

  • Wow, that is a LOT of sprites. Be careful to watch your VRAM usage!

    es, it's too much I think. I will tried to reduce the number of frame of my animation (20 to 8 or 10 could be great), to decrease the number of sprite for a map.

    This cap will show you how to change an animation, but it also shows some of the issues with using just one object, IE multiple behaviors.

    http://dl.dropbox.com/u/666516/multianimations.cap

    aho, thank you very much, it's great ! Thank you very much .

  • [quote:1zgbopz4]In GM, you can load several (multiple) sprites in a unique Object. If you want, you could create a game with only 1 object, and thousand sprites in it, with all the events for each sprite.

    In fact, we don't do that, but, it's easier to "manage" and organise 15-30 objects in a game than 150/300 objects and more .

    There's no reason why you can't do that in Construct. You just have to take into account that every frame you load must have an existing frame in game. So in theory you can have just one object, as long as that object's number of frames is equal the the maximum animation you plan on loading.

    h, sorry, I misspoke, I forgot to mention :

    "In GM, you can load several (multiple) sprites in a unique Object, at the same time (together(?))".

    it means that you can draw several-multiple sprites with one object, at the same time /together.

    We can do that in construct , to draw more that one sprite for an object at the same time ? If yes, I'm very interesting by the technic .

    (Because Construct is a very good application, and I would like to use it for my commercial games if I can ).

  • There's no real reason for a feature like that. You can achieve the same effect using multiple sprites. That's exactly what containers are made for.

    es, you're right, for little and medium (middle?) game. But for very very big game, I think it's a very usefull feature .

    [quote:1q2sovcy]How else would you tell the multiple images what to do? I don't know how GM does it, but since a sprite is basically an image anyway...

    his feature is very interesting to have an easy and good organisation in your cap.

    In GM, you can load several (multiple) sprites in a unique Object [edit]and draw the multiples sprites (of this unique object) at the same time/together[/edit]. If you want, you could create a game with only 1 object, and thousand sprites in it, with all the events for each sprite.

    In fact, we don't do that, but, it's easier to "manage" and organise 15-30 objects in a game than 150/300 objects and more .

    I will try to explain (sorry because, I'm not very good in english, so if it's not easy to understand, please tell me ).

    To explain, I have to show you all the calculs I have made for my game, to manage and organise the objects and the sprites.

    In my game (and in other big game), we can have :

    • 500/600 Mo of graphics (sprite : characters, fx, UI, enemies, NPC, grounds, trees, plants, objects...)
    • in a map (layout) I will have at least for the sprites : 4000 (characters)+150 (vegetations, house, pnj..) + 1280 sprites (enemies)+1000(UI+FX) = 6430 sprites differents to organise for a map.

    The calcul for the sprites:

    A lot of sprites will be reused, but not all. The sprites characters  + UI/fx will reused. Not the ennemies, and not necessary the vegetations/house/pnj.
    And I don't talk about the customisation :( (the ability for the player to change his cloth, sword...)
    
    [ul]
    	[li]1 player  : walk, sword combat, magic, dead, other animation > 5*8 directions*20 images = 800 sprites[/li]
    	[li]4 friends : 4*5*8*20 = 3200 sprites[/li]
    	[li]enemies : 4 differents by map- 2 animation (walk, fight) : 4*2*8*20 = 1280[/li]
    	[li]vegetations/house/pnj bu different univers : 10rocks + 10trees+10plantes+10 flowers+15grounds+1background (tiled)+10house+40little accessories/objects+5fx (fire, smoke..) +4pnj+others objects (actions, teleport, doors, fontain..).. >> between 110 and 150 sprites by univers[/li]
    [/ul]
    The differents "univers" are :  5 forests,  2 deserts,  2 moutains, 2swamp (marsh), 3 plains, 6 city, 3 prairies...... > 30 univers differents
    (My map are 5000*4000. And I think I will have 50 to 100 maps. Somes maps will be in the same "univers")
    So I will have  125*30 sprites for the vegetations/house/pnj > 125*30 = 3750 sprites.
    [/code:1q2sovcy]
    
    [ul]
    	[li]The objects : I can use of course 1 object for several sprites  :[/li]
    [/ul]
    [b]The objects : [/b]
    [code:1q2sovcy]
    The map :
    [ul]
    	[li]1 object player + 1 object shadow + 6 objects equipement + 1 object for the pathfinding (collision player)[/li]
    	[li]1 object friend + 1 object for the pathfinding (collision)[/li]
    	[li]1 object "PET" (animal) + 1 object for the pathfinding (collision)[/li]
    	[li]1 object enemi (for all the enemies in  the map) + 1 object for the pathfinding (collision)[/li]
    	[li]1 object tree-rocks-plante-flower-house-other objects (decor-stage set (?)) : no dynamics objects[/li]
    	[li]1 object for the tiled background[/li]
    	[li]1 object for the grounds (placed over the tiled background) ?[/li]
    	[li]5 or more objects "action" (teleport, safe (box), door, HP fontain, magic object..)[/li]
    	[li]1 object NPC -PNJ[/li]
    	[li]5 objects FX (fire, smoke..) and dynamic FX (Magic spells)[/li]
    	[li]1 object for the block collision (invisible)[/li]
    	[li]1 object for the target of the player[/li]
    	[li]the objects "drop", items.. : 4 differents[/li]
    [/ul]
    UI :
    [ul]
    	[li]UI for the enemies (health bar, info bar) : 3 objects[/li]
    	[li]UI for the PNJ : 4 objects[/li]
    	[li]1 object for the GUI (player)[/li]
    	[li]1 object by menu > 10 objects (inventory, spell book, quest book, option menu, pet menu, friend menu...)[/li]
    	[li]10 objects for the button of the menus (I don't want to use the button object) : button ok, close, radio, bar...[/li]
    	[li]1 object for the health bar-magic bar, xp bar[/li]
    	[li]icone objects (spells, sword used..) : 2 objects[/li]
    	[li]1 object Cursor[/li]
    [/ul]
    

    60/70 objects to organise for a layout.

    + the objects that I have forgotten, because we forget always some things.

    + the other objects to organise (text...) which aren't no sprite object, but we need to organise it too in our .cap :).

    [/code:1q2sovcy]

    So, I think I will have 60/100 Objects by map to organise.

    So, I prefer to have to organise 30-50 objects than 100 objects. It's easier.

    With the "multiple sprites in one object" feature, I think I could have only 40-60 objects to organise in my .cap, and it would be more cool for me .

    It's like to have folders with global variable. When we use only a fexw globale variable (10-20) in a game, it's not a problem. But, when we use a lot of global variable (50-100), it become really dificult to have a good organisation.

    I hope I have been clear .

    Thank you for help me .

  • Hi

    I try to make that :

    • I have an object named "enemy"
    • at the layout I create several instance of this object "enemy", with different vprivate variable (nammed "type").
    • with each value (for the variable private "type"), I want to load somes images (to have differents enemys, but with a unique object). So to have differents instances of the same object which dras diffirents images (animation).

    I have try with several animations, sub-animations, etc.. But, it doesn't work. I don't know why.

    http://blendman.free.fr/construct/enemyImages.zip

    Someone knows what I'm doing wrong ?

    Thank you

  • Thank you for your answers .

    [quote:3dumim9j]

    What I'm looking is the ability to change the frame of a unique sprite Object, but not for all the instance of this Object

    Ah. I'm not sure if there is a way to do that.

    es, I think it's not possible as easy as I expected.

    Perhap's with a special technic, plug in, or another hidden feature .

    [quote:3dumim9j][quote:3dumim9j]I try to understand, but if you would have an example, it will be more easy for me .

    It took me a month to figure out how to do it for my game, and I'm very busy. I might give it a shot, though.

    The example was quicker to make than I thought. It's a lot faster to make when you already know how to do it!

    .

    [quote:3dumim9j][quote:3dumim9j]perhap's with a plug ins, like with GM.

    Unless the "s" plug-in has some sort of feature like that, there aren't any others that have memory management. You'd have to create your own.

    think I know why. It's because Construct doesn't work like GM. In construct all the images are stocked in the ram, and only send to Vram when needed (if I have understand).

    So, we can't free the ram easily. Because if we do that, our images will be destroyed, and we 'll need to load them again when needed.

    [quote:3dumim9j][quote:3dumim9j]we can't use several image in a single sprite object ?

    No.

    k, a good feature request, so .

    I use this feature a lot with Gm, and it's very usefull to have a unique Object that can draw several image, for a lot of things (characters with different parts, UI...).

    Different animation frames / subanimations?

    I have tried, but it doesn't work in my example.

    I don't know what I'm doing wrong.

    My new example :

    http://blendman.free.fr/construct/enemyImages.zip

    PS : sorry for my bad english.

  • Hi

    I agree, it would be really usefull. Especially for big and professionnal games .

  • Great !!

    Thank you very much for this example. I will try to use in my game

  • > I don't know if there is another feature.

    > Can we load any file at the begining of the layout (with the image list or image manipulator, perhap's), and change the image sprite object when we desire ?

    >

    I'm confused. The feature you're asking for is load animation frame from file, which you said you're already using?

    n fact, it's not the same function as "load animation frame from file" I look for.

    Because this function replace an animation frame of a sprite by a new picture. But all the instance using this sprite object are changing.

    What I'm looking is the ability to change the frame of a unique sprite Object, but not for all the instance of this Object : Only by example for the instance which private value"type" = 3.

    Like in this example :

    • I create 20 Objects named "sprite" have different private variable value (1 to 5).

    I would like that for the instance with Private variable Type = 1, they have the image 01.png. For the instance which have the private variable type = 2, they have the image 02.png, etc..

    + Sprite.value('type') = 1
    -> load animation frame from file "data\01.png"
    +else
    + Sprite.value('type') = 2
    -> load animation frame from file "data\02.png"
    etc...[/code:2vnp95m7]
    But, in my file, it doesn't work. I don't know if we can do that, and how.
    
    I have made a little example (.cap with 4 images) :
    [url]http://blendman.free.fr/construct/spriteImage.zip[/url]
    
    [quote:2vnp95m7][quote:2vnp95m7]The RTS will not work fine good in this case (not square case, but "iso" (diamond ?)).
    quote:2vnp95m7]Is there another technic ? (simple if possible  ).
    
    It might be possible to hack together a system where you place node sprites all over the map (automatically via an event at runtime, of course!) arranged how you want isometrically, have a pathfinding sprite with RTS behavior that goes ahead of the player, keep track of which nodes it overlaps or it gets closest to, then have your character walk towards those node sprites in order. I don't know if that'll work, but I'm using a sort of hacked system like that in my game for node-based pathfinding.
      try to understand, but if you would have an example, it will be more easy for me  .
    
    [quote[quote:2vnp95m7]]ok. For Vram it's a good things to know. I use the "load textures per layout" settings in my game.
    IS it a way to free up the RAM ?
    My game with GM use only 5 - 10 Mo in ram, but with Construct, the same game use 80 Mo in ram.
    How can I change that  (if it's possible) ?
    
    Oops, sorry, I thought you were talking about VRAM. As far as I know, there's no way to control how much RAM construct is using.erhap's with a plug ins, like with GM.
    
    [quote:2vnp95m7][quote:2vnp95m7]ok. it's great. Can we use several image on a single sprite object ?
    For example :
    [ul]
    	[li]1 image for the character[/li]
    	[li]1 image for his shadow[/li]
    	[li]1 image for his sword[/li]
    [/ul]..
    On the same sprite object ?
    
    Yes, using multiple sprites and containers. [url=http://sourceforge.net/apps/mediawiki/construct/index.php?title=Containers]http://sourceforge.net/apps/mediawiki/c ... Containers[/url]
    ut we need to create several object Spirte, we can't use several image in a single sprite object ?
    
    
    [quote:2vnp95m7]I have tried it, but it doesn't in my example :
    
    Actually, you don't even need a for each here, just use "Always" instead.
    You will need to add an event to change its z to "place behind object" since the shadow was added to the layout after the shadow caster.
    h, yes, sorry, I have forgotten the always event to actualise the shadow 's position. Thanks.
  • Hi

    Thank you very much for the answer, it will help me a lot .

    Impressive stuff!

    As I am using construct for a commercial game as well, let me give you some advice and answer some of your questions.

    Making a map editor is completely possible.

    If you're going to have between 300-600 MB of graphics, you're probably going to have to roll your own image loading solution. Construct can take a while to compile if there's a lot of graphics in the .cap. Each time you edit the graphics and preview the application again with that many graphics, it's going to take an excruciatingly long time for it to compile.As such, if you put all of your graphics in a folder and load them from there, it will go much, much faster, as the game will only load the ones you need when you want them.

    Es, for the moment, I use the "load animation frame from file" feature to change my sprite, to avoid to have a too big time for compiling.

    I don't know if there is another feature.

    Can we load any file at the begining of the layout (with the image list or image manipulator, perhap's), and change the image sprite object when we desire ?

    [quote:3ec11ake]As for encrypting them, lucid's plugin "s" has encryption capabilities.

    hank for the information .

    I have find the "S" plugins from Lucid, and I will tried it.

    So I'm trying to create the same level editor as I have created with GM.

    But, I don't find a good pathfinding system (like A*).

    The RTS will not work fine good in this case (not square case, but "iso" (diamond ?)).

    [quote:3ec11ake]1. Attaching a shadow underneath characters is definitely possible, I'm doing it in my game right now. What you do is first, create the shadow object and give it a variable 'uid'.

    Then put every object that needs a shadow into a family, let's call it 'shadowfamily'.

    Give that family a variable 'shadow' via the family manager under the project tab.

    Have two events:

    if family's variable 'shadow' is equal to 0

    • create sprite "shadow"
    • set shadow's variable 'uid' to shadowfamily.uid
    • set shadowfamily's variable 'shadow' to 1

    event two

    for each shadowfamily

    if shadow's variable 'uid' is equal to shadowfamily.uid

    • set position of shadow to shadowfamily

    hank you very much for this tips, I will tried it .

    For the moment, I use the family to create the shadows for the non-animated object, and the turret for animated characters.

    Your technic seems to be better than the turret technic .

    [quote:3ec11ake]2. Yes, you can create objects from different layouts. The easiest way to get objects from different layouts to appear in all event sheets is to temporarily make the object global, then it will be accessible from every layout's event sheet. Remember to uncheck global when you're done!

    es, I have discover this feature (global), it's veru usefull.

    [quote:3ec11ake]3. The system object has an action that frees up VRAM, "load/unload layout textures." However, in the application properties, there is a setting for "load textures" - if that is set to per layout, then it will automatically load all textures needed for the layout at the start of a layout, and unload the previous layout's textures. There are a few new tips up about memory management on the wiki section on VRAM: http://sourceforge.net/apps/mediawiki/c ... ation_tips

    k. For Vram it's a good things to know. I use the "load textures per layout" settings in my game.

    IS it a way to free up the RAM ?

    My game with GM use only 5 - 10 Mo in ram, but with Construct, the same game use 80 Mo in ram.

    How can I change that (if it's possible) ?

    [quote:3ec11ake]4. I don't know of any way to do exclusively isometric pathfinding.

    nd for a normal pathfinding like A* with squarre cell ?

    The RTS behavior seems not working pretty well in some case.

    Is there another technic ? (simple if possible ).

    [quote:3ec11ake]5. Yes, using the image manipulator, you can load images from disk and copy and paste images to and from sprites. One limitation at the moment is you cannot create extra frames of animation at runtime. You'll need to make sure that the sprite has enough animation frames before you compile.

    k. it's great. Can we use several image on a single sprite object ?

    For example :

    • 1 image for the character
    • 1 image for his shadow
    • 1 image for his sword

    ..

    On the same sprite object ?

    [quote:3ec11ake]Welcome to the board.

    On the drop shadow I would suggest placing it into a container with the desired object, and placing that object into a family, rather than using a private variable.

    Code: Select all

    For each shadow

    -> shadow set position to family.character

    When its in a container with the object, its paired object is already picked./

    have tried it, but it doesn't in my example :

    shadow.cap

    [quote:3ec11ake]Also the Sprite object has a built in function to load an image directly to the desired frame, called "Load animation frame from file". You just have to make sure the animation is set to the frame number you want it to load to.

    es, I have seen that feature. Thanks .

  • hi

    thank you for your answers .

    why not use the conditions for creating an object as the conditions for whatever action it is you have in mind?

    think:

    instead of having a condition create an object and this creation of the object being another condition for yet another action

    why not:

    have the conditions that would create an object produce the actions you desire

    Yes, in most of case, I think it will be good in a lot of case.

    In fact, there is a sort of "create" event thanks to that feature : properties (for object), private and global variable too can be usefull in this case .

    Sorry no there is no specific function to do that, but fortunately Construct allows you to create just about any condition you can think of via private variables, globals, the Function object, and many other finite state objects.

    To do this with a private variable simply change the objects variable when its created, or destroyed. Then add a condition that always compares that variable, and does something when it changes.

    have made that and it works fine, thank you .

    [quote:26uasvwe]Even simpler is the Function object. With it you can call your own function when the object is created/ destroyed. Then you just make up your own function as:

    On function "myfunction"

    -> Do this

    have tried to create a function, and it work very weel, thank.

    If you have some examples of functions utility, I'm interested too.

    Thanks again