Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hechelion

Pages: 1 [2]
16
Thank eXpl0it3r for your answer.

My bad, the documentation is clear:
Quote
Warning
    SFML cannot preload all the font data in this function, so the stream has to remain accessible until the sf::Font object loads a new font or is destroyed.

don't notice this before, because all the resources (textures, sounds) I load as stream bytes, since they are packed.
Since the other resources don't have this behavior, I just used the same code to load the fonts.

My apologies and thanks for your answers.

17
Thanks for answering, I know that SFML is very stable, but vb net is a language that does not have pointers, that does not allow you to select where in memory you can create a variable.
Even if I wanted to, it would be impossible for me to overlay a memory area.

I don't have any other similar errors, neither in textures, nor in sound, only with the text.

I have not been able to test with SFML 2.5 because it is only distributed as nutmeg and I have never used net framework with nutmeg. updating could be cause of other errors due to my inexperience with nutmeg.

I know the font is not corrupted by the following:
I have been doing new tests and have found that the problem only occurs when creating a font from a byte stream.

This code work fine:
Code: [Select]
oMeta.oGameData.AddFont("mplus", New SFML.Graphics.Font("mplus.ttf"))

This code result in corrupt TEXT (but only, after this "Private plstGamePad(199999) As UInt32" )
Code: [Select]
Dim fStreamData As New FileStream("mplus.ttf", FileMode.Open)
Dim bdata As New BinaryReader(fStreamData)
Dim bytes = bdata.ReadBytes(bdata.BaseStream.Length)
oMeta.oGameData.AddFont("mplus", New SFML.Graphics.Font(bytes))
bdata.Close()
fStreamData.Close()

What bothers me, is that I have not been able to reproduce the error with minimal code.

I know that with a more complex code it is difficult to detect where the error occurs, so it is logical to think that the error is caused by my code.
But if my code was the problem. Why does changing the font load the problem disappear?

18
DotNet / [SFML2.4 - VB NET 4.5.2] Overlap memory with heavy font files.
« on: August 21, 2021, 07:24:58 am »
Hi.
I have an very odd error.

I have finished a game (Evorales), this game works without any problem.
Now I am trying to add the Japanese language, which meant changing the fonts files (the ones I was using originally did not support Japanese characters).

At changing the fonts, the game began to give memory errors or texts that did not display well (and I don't mean string encoding problems).



Exactly the same source code, just changing the font files.

- Change "steamwreck" (35 kB)  for "NotoSerifCJKjp-hinted" (23 MB ), rear/write protected area memory error from sfml-graphics.dll when used SFMLwindows.draw(TEXTobject)
There was no error loading the font or creating the TEXT objects

- Change "steamwreck" (35 kB)  for  "mplus" (1300 kB), no memory error, but text strings were displayed with errors, for example "spaol" instead of "Español", etc.


After several hours of testing, I found that when creating a very big array to store the game's keystrokes, it overwritten the same memory area used by the font, causing this problem.

In my particular case, creating these variables somehow corrupts the font texture
Code: [Select]
Private plstGamePad(199999) As UInt32

Change 199999 for other number more small (999) or even more greater (999999) solve all previus TEXT problems.


My assumption is that the SFML implementation in NET does not reserve memory properly when loading font files. Apparently this error is notorious only with relatively large files.

I tried to produce a minimal code that would replicate the problem, but it was impossible, due to the limitations of the language when reserving memory.


19
SFML projects / Re: Evorales Bullet hell game.
« on: August 19, 2021, 05:17:09 pm »
Here  ;D
https://store.steampowered.com/app/1682840/Evorales/

I originally didn't want to post it so it wouldn't be confused as spam. 

20
SFML projects / Evorales Bullet hell game.
« on: August 19, 2021, 07:44:53 am »
Hi.
Evorales It is a project that I have been working on for the last 4 years and published on Steam 2 weeks ago.
It is a classic bullet hell with mechanics similar to "cave" shmups games.

It is programmed with vb studio, Net framework 4.5.2 and SFML (graphics, sounds, music and input).







Trailer


Here a gameplay from a friends (spanish)


About the game
Defeat the gnu-demon and his army and save the day in this top-down bullet hell focused on slowdown and bullet time mechanics. Easy to play but hard to master, it requires great strategy if you aim for a hi-score while dodging bullets across 12 hand-drawn, steampunk aesthetic stages, set in South America at the end of the 19th century, in an alternate universe.​

Evorales is inspired by the classic games of the mid-90s but with a Danmaku twist.
The first time you play it might seem like a very difficult game, but mastering the Alma and Ultra modes is the key to finishing the game and getting amazing scores.


21
DotNet / [SFML2.4 - VB NET 4.52] Vertex Array doubts
« on: December 13, 2019, 04:48:24 am »
Hi.
I try to work with vertex array over VB NET 2.4, and I discovered the following:


if I Try to draw a triangle with this code:
Code: [Select]
dim pX as integer = 100
dim pY as integer = 100
dim pVertex(2) as Vertex

pVertex(0) = New Vertex(New Vector2f(pX, pY), New Color(255, 0, 0, 255))
pVertex(1) = New Vertex(New Vector2f(pX+64, pY), New Color(255, 0, 0, 255))
pVertex(2) = New Vertex(New Vector2f(pX+64, pY+64), New Color(255, 0, 0, 255))

oRtScreen.Draw(pArrayAura, PrimitiveType.Triangles)

Work perfect.

But, if I declare the vertex without any parameter, and then try to set the value, then, SFML don't draw anything, but don't report any error.

Code: [Select]
dim pX as integer = 100
dim pY as integer = 100
dim pVertex(2) as Vertex

pVertex(0) = New Vertex()
pVertex(1) = New Vertex()
pVertex(2) = New Vertex()

pVertex(0).position = New Vector2f(pX, pY)
pVertex(1).position = New Vector2f(pX+64, pY)
pVertex(2).position = New Vector2f(pX+64, pY+64)

pVertex(0).color =  New Color(255, 0, 0, 255)
pVertex(1).color =  New Color(255, 0, 0, 255)
pVertex(2).color =  New Color(255, 0, 0, 255)

oRtScreen.Draw(pArrayAura, PrimitiveType.Triangles)

Don't work, but don't show any error.

Any idea why this happens?

22
Thank for the answer eXpl0it3r.

23
Thank for the explanation eXpl0it3r.

One last question. This bug is a general SFML bug or only for the sfml.NET implementation?

24
Hi, this is my first post here, but I have a time reading the forum.

I have a very rare and funny problem, I tried to find other similar bug but no luck.

Description:
Randomly a sprite area change when I move the sprite.

I create only one time a sprite from a Texture with a "intrect", the texture and the sprite are power of 2  (texture 512*256 and sprite 64*64).
In the main loop, I'm only move the sprite with the position method, in some frame the drawing looks perfect, but in others, a part of the texture that is not originally in the sprite appears on the screen.

What I did notice is that the bug does not appear if the speed is a rational number, example VelX = VelY = 0.5, etc.

code:
Code: [Select]
Imports SFML.Window
Imports SFML.System
Imports SFML.Graphics

Public Class FrmFrameWork
    Dim WithEvents SFMLwindow As RenderWindow

    Private Sub FrmFrameWork_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim auxStyles As Styles = Styles.Default

        Dim MainLoop As Boolean = True
        Dim auxTimer As Integer = 0

        SFMLwindow = New RenderWindow(New VideoMode(1366, 768), "Prueba error SFML ", auxStyles) 'styles.fullscreen
        SFMLwindow.SetVisible(True)
        SFMLwindow.SetVerticalSyncEnabled(False)
        SFMLwindow.SetFramerateLimit(60)

        Dim texTest As New Texture("proyectiles2.png")
        Dim rctTest As IntRect
        rctTest.Width = 64
        rctTest.Height = 64
        rctTest.Left = 0
        rctTest.Top = 64
        Dim sprTest As New Sprite(texTest, rctTest)

        Dim PosX, PosY As Single
        Dim VelX, VelY As Single

        VelX = 4 * Math.Sin(15 * Math.PI / 180)
        VelY = 4 * Math.Cos(15 * Math.PI / 180)

        While MainLoop
            SFMLwindow.DispatchEvents()

            If Keyboard.IsKeyPressed(Keyboard.Key.Escape) Then MainLoop = False 'ESC siempre cierra el juego

            SFMLwindow.Clear(Color.Black) 'Limpiamos la pantalla

            auxTimer += 1
            If auxTimer Mod 30 = 0 Then
                PosX += VelX
                PosY += VelY
                sprTest.Position = New Vector2f(PosX, PosY)
            End If

            'auxSprite = New Sprite(oMeta.oRtScreen.Texture)
            'auxSprite.Position = oMeta.posScreen
            SFMLwindow.Draw(sprTest)

            SFMLwindow.Display()
        End While

        SFMLwindow.Close()
        Me.Close()


    End Sub
End Class


Detail:
I have the same problems with 2 PC.
PC 1
SFML.NET 2.2(32bit) + NET 4.52
VB NET community 2017
OS: Windows 10
CPU: Intel i7 3610qm
GPU: Nvidia GTX 660m

PC2
SFML.NET 2.4(64bit) + NET 4.52
VB NET Community 2019
OS: Windows 10
CPU: Intel i7 4790
GPU: 4095MB NVIDIA GeForce GTX 980 (MSI)

I always have my drivers and OS updated


PD: Sorry for my English is not my native language.

Pages: 1 [2]