In the presence of self-gravity, we investigate the self-similar dynamics of a relativistically hot gas with or without shocks in astrophysical processes of stellar core collapse, formation of compact objects, and supernova remnants with central voids. The model system is taken to be spherically symmetric and the conservation of specific entropy along streamlines is adopted for a relativistic hot gas whose energy-momentum relation is expressed approximately by ε = cp with ε and p being the energy and momentum of a particle and c being the speed of light. In terms of equation of state, this leads to a polytropic index γ = 4/3. The conventional polytropic gas of P = κρ , where P is the thermal pressure, ρ is the mass density, γ is the polytropic index, and κ is a global constant, is included in our theoretical model framework. Two qualitatively different solution classes arise according to the values of a simple power-law scaling index a, each of which is analyzed separately and systematically. With explicit conditions, all sonic critical lines appear straight. We obtain new asymptotic solutions that exist only for γ = 4/3. Global and asymptotic solutions in various limits as well as eigensolutions across sonic critical lines are derived analytically and numerically with or without shocks. By specific entropy conservation along streamlines, we extend the analysis of Goldreich & Weber for a distribution of variable specific entropy with time t and radius r and discuss consequences in the context of a homologous core collapse prior to supernovae. As an alternative rebound shock model, we construct an Einstein-de Sitter explosion with shock connections with various outer flows including a static outer part of a singular polytropic sphere (SPS). Under the joint action of thermal pressure and self-gravity, we can also construct self-similar solutions with central spherical voids with sharp density variations along their edges.