Request for Implementation of prototypes.sprite Interface

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
plexpt
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Mon Feb 07, 2022 2:32 am
Contact:

Request for Implementation of prototypes.sprite Interface

Post by plexpt »

Dear Factorio Development Team,

I hope this message finds you well. I am writing to request the implementation of a `prototypes.sprite` interface in Factorio. This feature would significantly enhance the capabilities of mod developers and provide more flexibility in creating dynamic and interactive mods.

### Rationale

1. Enhanced Modding Capabilities:
- Dynamic Content Creation: With access to all available sprites, mod developers can dynamically generate content based on the available resources. For example, creating custom GUI elements, tooltips, or in-game effects that utilize existing sprites can greatly improve the user experience.
- Consistency and Integration: Developers can ensure that their mods integrate seamlessly with the base game and other mods by using the same visual elements. This consistency enhances the overall look and feel of the game.

2. Improved User Experience:
- Customization: Players can benefit from mods that offer more customization options, such as custom skins, icons, and visual themes. Access to all sprites allows mod developers to create these customizations more easily.
- Accessibility: For players with visual impairments, mods can provide alternative visual representations using the available sprites, making the game more accessible.

3. Educational and Research Purposes:
- Learning and Teaching: Access to all sprites can be valuable for educational purposes, allowing educators to create tutorials and learning materials that demonstrate the use of sprites in game development.
- Research: Researchers studying game design and user interaction can benefit from having access to all sprites, enabling them to analyze and understand the visual elements used in the game.

4. Community Engagement:
- Modder Community: Providing this interface would foster a more active and engaged modder community. Developers can share and collaborate on projects that utilize the available sprites, leading to a richer and more diverse mod ecosystem.
- Player Community: Players would have access to a wider range of high-quality mods, enhancing their gaming experience and keeping them engaged with the game.

### Proposed Implementation

The proposed `prototypes.sprite` interface could be structured similarly to existing prototype tables, such as `prototypes.entity` or `prototypes.item`. Here is a suggested structure:

Code: Select all

-- Example usage
local all_sprites = prototypes.sprite

-- Iterate over all sprites
for name, sprite in pairs(all_sprites) do
    log("Sprite: " .. name)
    -- Optionally, log more details about the sprite
    log(serpent.block(sprite))
end
Each entry in the `sprite_prototypes` table would contain the following information:
- Name: The unique name of the sprite.
- Path: The file path or identifier of the sprite image.
- Dimensions: The width and height of the sprite.
- Properties: Any additional properties or metadata associated with the sprite.

### Conclusion

Implementing the `prototypes.sprite` interface would be a significant enhancement to the modding capabilities of Factorio. It would empower mod developers to create more dynamic, consistent, and engaging content, ultimately benefiting both the modding community and the player base.

Thank you for considering this request. I look forward to your response and any updates on this feature.

Best regards
Rseding91
Factorio Staff
Factorio Staff
Posts: 14247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Request for Implementation of prototypes.sprite Interface

Post by Rseding91 »

I'm not understanding the utility of such an API. You can already reference the sprites in things like custom GUIs, rich text and so on. What do you actually want to do that you can't do now?

Have you tried pressing CTRL + SHIFT + E?
If you want to get ahold of me I'm almost always on Discord.
plexpt
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Mon Feb 07, 2022 2:32 am
Contact:

Re: Request for Implementation of prototypes.sprite Interface

Post by plexpt »

When was CTRL + SHIFT + E added?
I never noticed it before.
I am much more comfortable using it.
plexpt
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Mon Feb 07, 2022 2:32 am
Contact:

Re: Request for Implementation of prototypes.sprite Interface

Post by plexpt »

Can this page be opened using runtime api code?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Request for Implementation of prototypes.sprite Interface

Post by Rseding91 »

plexpt wrote: Wed Nov 20, 2024 5:56 am When was CTRL + SHIFT + E added?
April of 2020.
Can this page be opened using runtime api code?
It can only be opened by pressing CTRL + SHIFT + E or by hovering the mouse over something and pressing CTRL + SHIFT + F to open the page for that specific thing.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding interface requests”