This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4111 closed defect (fixed)

[PATCH] Particles of the previous map remain when starting a new game

Reported by: elexis Owned by: Vladislav Belov
Priority: Must Have Milestone: Alpha 22
Component: Core engine Keywords: patch
Cc: Patch:

Description

The particles of the previous map remain when starting a new game on a different map.

Reproduce:

  1. Make sure to enable particles in the options
  2. Start a map with particles, like red sea (lot of dust) or volcano (with smoke in the middle)
  3. Stop the game. Start a new one on for example anatolian plateau

Result: The smoke/dust is still visible until the animation ran out.

Attachments (3)

4111_particles.patch (569 bytes ) - added by Vladislav Belov 8 years ago.
Adds the clear function's call (at game start), which remove old emitters
4111_particles.2.patch (686 bytes ) - added by Vladislav Belov 8 years ago.
4111_particles.3.patch (1.2 KB ) - added by Vladislav Belov 8 years ago.
Fixed elexis suggestion about logic in the GameSetup

Download all attachments as: .zip

Change History (10)

by Vladislav Belov, 8 years ago

Attachment: 4111_particles.patch added

Adds the clear function's call (at game start), which remove old emitters

comment:1 by Vladislav Belov, 8 years ago

Problem is that ParticleManager has a list of unattached emitters, which won't be cleared on a start of new game.

Last edited 8 years ago by Vladislav Belov (previous) (diff)

comment:2 by Vladislav Belov, 8 years ago

Keywords: rfc added
Milestone: BacklogAlpha 22
Owner: set to Vladislav Belov
Summary: Particles of the previous map remain when starting a new game[PATCH] Particles of the previous map remain when starting a new game

comment:3 by elexis, 8 years ago

Game.cpp should be agnostic of the Renderer details as far as possible. If you can't move it to the renderer or particle manager directly, perhaps you can send a GameStarted event or something like that to that place.

by Vladislav Belov, 8 years ago

Attachment: 4111_particles.2.patch added

comment:4 by elexis, 8 years ago

GameSetup.cpp should stay agnostic of the renderer logic too IMO, how about Gamesetup.EndGame -> Renderer.EndGame ?

in reply to:  4 comment:5 by Vladislav Belov, 8 years ago

Replying to elexis:

GameSetup.cpp should stay agnostic of the renderer logic too IMO, how about Gamesetup.EndGame -> Renderer.EndGame ?

But should renderer know about the game? It should render. What's better: GameSetup agnostic of the renderer logic or Renderer should stay agnostic of the GameSetup?

Version 1, edited 8 years ago by Vladislav Belov (previous) (next) (diff)

by Vladislav Belov, 8 years ago

Attachment: 4111_particles.3.patch added

Fixed elexis suggestion about logic in the GameSetup

comment:6 by elexis, 8 years ago

Resolution: fixed
Status: newclosed

In 18936:

Clear particle emitters when ending a game so they don't leak into new games. Patch by Vladislav, fixes #4111.

comment:7 by elexis, 8 years ago

Keywords: patch added; rfc removed

Thanks for the patch and explanations Vladislav!

Note: See TracTickets for help on using tickets.