设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 86|回复: 0

[制作教程] Designing a Script for Composite Character Sprites

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4456

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22919
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28269

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式


    In this article we will be looking at a concept called "Composite Sprites", and how it can be used to implement composite characters in RPG Maker. This article is solely focused on coming up with the specifications and design that the script will be built on.

    It goes through an overview of what we want to accomplish, and the steps involved to arrive at a solution that seems feasible to implement.

    Background

    Composite Sprites is an established concept. For example, if we look at the Torque2D wiki, they define a composite sprite as

    a sprite by name that is a composite of multiple other sprites "inside" it. These sprites can be placed in any location and can be of any size, orientation, blending, sort-point, scene-depth, etc.You're basically grouping multiple sprites together so that you can control all of the sprites together rather than having to figure out how to synchronize each separate sprite. For example, suppose you have a circle and a square beside each other. If we group them together, we can then move both sprites together, allowing us to preserve their relative positions without having to worry about moving each sprite individually. Moving the whole group 5 units to the left would move each sprite 5 units to the left.The idea of grouping objects together is not unique to game development or graphics. Many applications allow you to take multiple, separate objects and group them together.

    Composite Character Sprites

    Suppose you had two equip slots: one for a weapon, and one for your armor. If you had 10 weapons and 30 pieces of armor, and you wanted your character's appearance to reflect what they are currently using or wearing, you have 341 possible combinations to choose from, including no weapon or no armor, or both). If you needed to draw 341 different sprites for one character, you will probably scrap the idea. And this is a very simple case where you have two equip slots. Add another slot, and you have even more possibilities to consider. Drawing each complete sprite is not a scalable solution at all, both in time and in file size.

    The fundamental idea behind composite characters is to have the game engine generate these sprites for you by composing different sprites together to form your character sprite. All you have to do is provide the pieces and tell the engine when to use which piece, and everything should work out.

    Now, instead of drawing thousands of sprites, all you need is to draw each piece of equip separately.

    Composite sprites come in handy here because your character is composed of multiple sprites, and when the character moves, all sprites need to move in-sync as well.

    Creating the Requirements

    Since we're making something ourselves, we have control over everything, including what we want the script to do. Let's start by considering only armors.

    User Input


    • Allow users to choose which image to use for each armor.
    Scripting

    • Build a sprite based on all of the armors that the character is wearing
    • Cache the sprite somewhere to avoid having to rebuild the sprite everytime we need to use it
    • Rebuild the sprite whenever an armor is changed
    These requirements are the bare minimum to have a working script. Additional requirements may come up later on, but for now this is where we start.Identifying the Constraints

    Any problem-solving begins by looking at what we're working with. This largely dictates what direction our solution will go.

    Constraints


    • Character sprites must conform to a particular specification (3 rows, 4 columns)
    • You can use one spritesheet per image (VX standard) or hold 8 sheets per image (Ace standard)
    These are the default constraints. Other than that, there isn't much to worry about at this point, though once we start looking at code that might be a different story.If you are using scripts that don't follow these specs, then you will need a patch since I'm designing a solution based on the default specs.

    Designing a Solution

    Read the rest at HimeWorks!


    本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/designing-a-script-for-composite-character-sprites.34370/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 15:47 , Processed in 0.065094 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表