terça-feira, 22 de fevereiro de 2022

arlequim project pt.2: resuming the project

I'm posting again on the blog to give a brief update about a project I finally resumed after about a year. I restarted the procedural interactive fiction project, that for now I'm still calling Arlequim (Harlequin in portuguese), since it's still a prototype.

I decided to start the code from scratch, since I improved a lot as a C# coder in the mean time and also took some better decisions regarding pipeline and planning. Instead of immediatly starting the visual interface, even with temporary graphics, I'm still designing the scenes independently of each other in an editor window that allows me to simulate the whole scene. One of the great advantages of the game structure being segmented in generic scenes with flexible roles is that it becomes easy to test the arc and the internal dynamics of a scene in a self contained manner, without having to play or simulate big portions of the game.

My objective for the rest of the month is either developing the visual interface for testing the interaction with the scene, dragging the characters inside and out of it, or investing more time on designing scene models, developing a bit of a bigger set and making their designs more interesting before making a playable visual prototype of the system. As I mentioned before, it's possible to test if the internal dynamic of a scene is working just by the simulation on the editor window.

At the moment I'm iterating on the design of a verbal argument scene between two parties of characters, with one possible neutral side trying to mediate the situation, attempting to get the weights and the algorithm for act selection right, to achieve an interesting arc.

The scene simulation window with argument scene and the current act that is happening, there's already a sliver of functional text generation to express the events.

 

As I mentioned in the previous post, months ago (I think I did), the chance of an act being drawn and expressed depends on the aspects that make up the current scene's context, an act of conflict has a better chance of happening if the scene has a big degree of conflict, this act then increases the degree of conflict in the scene leading to this feedback loop. I'm now trying to find the weights and functions that will create an explicit arc, like a scene becoming increasingly more conflictual, while not preventing many different acts from occuring.

The ideal is to balance the identity and legibility of a scene with a reasonable swat of possibilities. What I mean by that is, during a scene I want the player to be able to see that it is threading certain specific paths, like conflict or introspection, for it to be easy to make a reading of the situation and for the scene to gain a specific identity among its other possibilities (with different characters, for instance), but I also don't want for a single path to dominate the whole scene.

If all the acts are conflict, it's obvious where the scene is going and there is no tension, being too boring for the scene to happen in such a predictable way. The ideal would be to have two or three possible threads, so the player can have  expectation of how the scene ends. 

To test this I started to work on an automatic testing process that runs the whole scene at once and emmits me a report of what role was assigned to which character, what was the sequence of acts, with what aspects the scene ended with, how many acts it took to finish, what was the ending and what changes on the world state happened throughout.

My goal here while testing the scenes is for them to consistently end with a few dominant aspects, giving identity to each scene instance, with a series of acts that correspond to this aspects, especially the one that ends the scene, the most salient one. It doesn't matter if the aspects grow in an interesting way if it's not possible to notice this having na impact on the sequence of acts.

This is all too abstract yet, I'm gonna write another post through this month detailing how I develop the model of a scene, how the game instances it and how I'm planning to design each one, to try and give a good little dynamic to each of them. I wish I had written more, but I'm really tired at the moment.

For now I just wanted to tell that I resumed the project and what part of it I'm developing right now.

segunda-feira, 14 de fevereiro de 2022

projeto arlequim pt.2: retomando o projeto


Estou postando novamente no blog para dar um breve update de um projeto que eu finalmente retomei depois de quase um ano. Eu reiniciei o projeto de ficção interativa procedural, que por enquanto ainda estou chamando de arlequim visto que ainda está em fase de protótipo.

Decidi recomeçar o código do zero, visto que melhorei muito enquanto programadora de C# nesse meio tempo e também tomei umas decisões melhores de pipeline e planejamento. Ao invés de já recomeçar a interface visual, mesmo com gráficos temporários, por enquanto estou trabalhando as cenas de forma independente e auto contida em uma janela de editor que me permite simular a cena toda. Uma das grandes vantagens da estrutura do jogo ser segmentada em cenas genéricas com papéis flexíveis é que fica fácil de testar o arco e a dinâmica de uma cena de forma auto contida, sem precisar jogar ou simular grandes porções do jogo.

Meu objetivo para o resto do mês é ou desenvolver a interface visual para testar a interação com a cena, arrastando personagens para dentro ou fora dela, ou investir mais nos modelos de cena, desenvolvendo um conjunto maiorzinho e já deixando o design delas mais interessante antes de fazer um protótipo jogável do sistema. Como eu falei antes, é possível testar se a dinâmica interna de uma cena está dando certo só pela simulação na janela de editor.

No momento estou iterando o design de uma cena de discussão verbal entre dois conjuntos de personagens, com um possível lado neutro tentando mediar a situação entre os os dois, buscando acertar os pesos e os algoritmos de seleção dos atos para ter um arco interessante acontecendo.

A janela de simulação da cena de discussão com os dados gerais da cena e do ato ocorrendo no momento, já tem um princípio de geração de texto funcional para expressar os eventos.

 

Como falei na postagem anterior, meses atrás, a chance de um ato ser sorteado e expressado depende dos aspectos que formam o contexto atual da cena, um ato de conflito tem mais chance de acontecer se a cena tem um grau muito grande de conflito, esse ato então aumenta o grau de conflito da cena levando a esse loop de retroalimentação. Eu estou tentando agora achar os pesos e algoritmos que vão criar um arco bem explícito, como um cena ficando cada vez mais conflituosa, mas que ao mesmo tempo não impeça atos diferentes de acontecerem.

O ideal é balancear a identidade e legibilidade da cena com uma gama razoável de possibilidades. O que quero dizer por isso, no decorrer de uma cena, quero que o jogador consiga ver que ela está seguindo um caminho específico, como conflito ou introspecção, para que seja fácil de criar uma leitura da situação e a cena ganhe uma identidade específica dentre as suas outras possibilidades (com personagens diferentes, por exemplo), mas também não quero que um único caminho domine a cena toda.

Se todos os atos forem de conflito, fica óbvio para onde aquilo está indo e não tem tensão nenhuma, sendo muito sem graça assistir a cena acontecendo de forma previsível. O ideal seria ter dois ou três caminhos possíveis, para que o jogador fique na expectativa de saber como a cena acaba.

Para testar isso comecei a programar um processo de testagem automática que roda a cena toda de uma vez e me emite um relatório mostrando que papéis foram dados para que personagem, qual foi a sequência de atos, com quais aspectos terminou o contexto da cena, quantos atos ela durou, qual foi seu ato final e que mudanças no estado do mundo ocorreram no decorrer dela. Uma vantagem grande do jogo conseguir jogar a si mesmo.

Meu objetivo testando as cenas dessa forma é conseguir de forma consistente que a cena termine com alguns aspectos claramente dominantes, dando identidade pra aquela instância, com atos que expressam corretamente esses aspectos, especialmente o ato que encerra a cena, o mais marcante. Não adianta os aspectos acumularem de um jeito interessante se não é possível notar isso tendo um impacto legível no decorrer dos atos.

Tudo isso é muito abstrato ainda, ao longo do mês vou escrever uma nova postagem detalhando melhor como eu monto o modelo de uma cena, como o jogo cria uma instância dela e como estou planejando o design de cada uma, para tentar dar uma dinâmica interna legal para cada modelo. Queria ter escrito mais agora, só que estou muito cansada no momento.

Por enquanto, só queria anunciar que retomei o projeto e que parte dele estou trabalhando agora. Até depois.

Floreio, minha gramática de geração procedural de texto

Gostaria de falar um pouco da ferramenta de geração procedural de texto por gramática de substituição que eu venho desenvolvendo na Unity pa...